What are Blogger condition tags?
Blogger conditional tags usually have the <b:if cond=..> starting and an ending of </b:if>.These codes are actually the condition that we keep.We use blogger conditional tags to show certain things only in homepage.or some other things only in post pages.We can there by control where the widget or item should be visible.Lets go into further details
To display only in homepage !
If we want a widget or an item to be displayed only in homepage and not in anyother pages or post pages we use the following code.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<p> This text is only visible in Homepage</p>
</b:if>
Displaying it anywhere except Homepage .
If you want any items/widget /adsense/code to be displayed in all pages except the homepage,we use the following code<b:if cond='data:blog.url != data:blog.homepageUrl'>
<p>This text will be displayed everywhere except on home page</p>
</b:if>
Example of using the above code for a widget
<b:widget id='HTML1' locked='false' title='Testing Widget' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'> <!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if></b:includable>
</b:widget>
To display it only on post/item pages
If you want a certain thing to be visible on on those pages where you have posted ,we use the below code
<b:if cond='data:blog.pageType == "item"'>
<p>Text for post pages only</p>
</b:if>
To display it anywhere except Item/post pages
<b:if cond='data:blog.pageType != "item"'>
<p>Text for everywhere except item pages</p>
</b:if>
To display on Static Page Only
To display html code only on static pages.we use the following code
<b:if cond='data:blog.pageType == "static_page"'>
<p>Text for static pages only</p>
</b:if>
To display html code everywhere except static page
<b:if cond='data:blog.pageType != "static_page"'>
<p>Text for everywhere except static pages</p>
</b:if>
To display only on Specific URL Only
To display only on specific post URL we use the following code
<b:if cond='data:blog.url != "http://prohackertools.blogspot.com/2013/03/top-5-best-blogger-widgets-of-2013.html"'>
<p>Text will display on above URL only</p>
</b:if>
To display only on Archive Pages
To display it only only on Archive Pages.
<b:if cond='data:blog.pageType == "archive"'>
<p>Text for Archive pages only</p>
</b:if>
To display it anywhere except the Archive pages
<b:if cond='data:blog.pageType != "archive"'>
<p>Text for everywhere except Archive pages</p>
</b:if>

Awesome info..Bookmarked thesite..I learned many a thigs from here
ReplyDeleteBrother I am using iframe code below my post tilte and it affecting my blog traffic badly. is there any way to use iframe below post title without being abandoned by search engines? before you were also using adsense below post title but now you are not doing so, I think you also faced the same problem. If yes reply me please for solution.
ReplyDeleteFantastic post! This just what I've been looking for. Thanks bro.
ReplyDelete