List of Conditional Tags that Target Specific Pages for Blogger

BELOW is a list of conditional tags that target specific pages. I only list the opening tags here. Just make sure you include the closing </b:if> tag when applying a conditional in your template.
Index (list) pages.

List of Conditional Tags that Target Specific Pages for Blogger


Index pages (homepage, labels page , archive page):
<b:if cond='data:blog.pageType == "index"'> 

Post (item) pages:
<b:if cond='data:blog.pageType == "item"'>
Static pages:
<b:if cond='data:blog.pageType == "static_page"'>
Archive pages:
<b:if cond='data:blog.pageType == "archive"'>
Homepage:
<b:if cond='data:blog.url == data:blog.homepageUrl'>
Specific page/URL:
<b:if cond='data:blog.url == "Page_URL_HERE"'>
Post and static pages:
<b:if cond='data:blog.url == data:post.url'>
Label-search pages:
<b:if cond='data:blog.searchLabel'>
First post(This is not a page, but a conditional for the first post. Used for targeting the first post on multi-post pages)
<b:if cond='data:post.isFirstPost'>
Applying conditional tags 
To apply a conditional tag to a content, simply put the content between 
the opening <b:if cond…> and the closing </b:if>, like so:

<b:if cond='data:blog.pageType == "item"'>
CONTENT (TO BE EXECUTED IF CONDITION IS TRUE)
</b:if>

In the example above, the content will only appear on post pages.
If you want to specify a alternate content (when the condition is false), you need to insert a <b:else/> tag followed by the content, like this:

<b:if cond='data:blog.pageType == "item"'>
CONTENT 1 (TO BE EXECUTED IF CONDITION IS TRUE)
<b:else/>
CONTENT 2 (TO BE EXECUTED IF CONDITION IS FALSE)
</b:if>
You can place the conditional anywhere in your template HTML, except inside a section or inside a widget content box. The content can be a div, a section, a style tag, another conditional tag etc.
Reversing a condition A condition can be reversed simply by replacing the comparison operator from== (is equal to) to != (is not equal to), like so:

<b:if cond='data:blog.pageType != "item"'> CONTENT (TO BE EXECUTED IF CONDITION IS TRUE)
</b:if>

In the example above, the content will only appear on pages other than post pages (i.e. removed/hidden from post pages). This method is not applicable to Label-search and First Post conditionals.***

Post a Comment for "List of Conditional Tags that Target Specific Pages for Blogger"