Essential Conditional Tags For Blogger

1 Min Read

There are a few tricks to hide elements from the blogger blog, You can hide elements in the homepage, posts, and static pages by adding conditional tags.

here are some essential conditional tags for you to hide your elements

Showing widget only on the home page:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
Your_widget_code_here
</b:if>

View the widget only on post pages:

<b:if cond='data:blog.pageType == "item"'>
Your_widget_code_here
</b:if>

Displays widgets only on specific pages:

<b:if cond='data:blog.url == "URL of the page"'>
Your_widget_code_here
</b:if>

Note: Change your URL in the address you want.

Hiding widgets only on specific pages:

<b:if cond='data:blog.url != " URL of the page "'>
Your_widget_code_here
</b:if>

Displaying widgets on the static page:

<b:if cond='data:blog.pageType == "static_page"'>
Your_widget_code_here
</b:if>

Hide the widget on a static page:

<b:if cond='data:blog.pageType != "static_page"'>
Your_widget_code_here
</b:if>

widget displays only on archive pages:

<b:if cond='data:blog.pageType == "archive"'>
Your_widget_code_here
</b:if>

After you add the conditional tags above, save the template and view the results. This conditional tags not limited to the widgets, with the help of conditional tags you can wrap the other elements such as Script, CSS, and HTML.

Share This Article
By admin Administrator
Follow:
Success is no accident. It is hard work, perseverance, learning, studying, sacrifice and most of all, love of what you are doing or learning to do.