How to Show or Hide Widgets in Blogger

Some questions that are most asked are : How to Show blogger widget on homepage only? How can I show widgets only on sub pages? How can I hide widgets on Static pages? How to show widgets on selected pages in blogger? Today I have bring solution to all these question in one place. It is really important to have control on your blogger widgets it will help you to make your blog more attractive.


So how do we actually do this. The trick is really simple. You just need to enclose your widgets in few pieces of codes. So lets jump straight on how to manage widgets on different pages in blogger.

Its often the HTML/JavaScript widget that is widely used for adding your customized widgets to Blogger and its mostly this widget that needs to be easily managed. Since you often paste some widget code inside HTML/JavaScript widgets so the only extra thing that you need to do in order to control widget’s display is to enclose that code between two pieces of code as shown in each control codes below,

How to Show Widgets Only On Homepages?

Simply enclose the code inside HTML/JavaScript widget between these lines,

<b:if cond='data:blog.url == data:blog.homepageUrl'>
WIDGET CODE GOES HERE
</b:if>
where WIDGET CODE GOES HERE is the code of the widget you want to show or hide.

How to Hide Widgets On Homepages?

<b:if cond='data:blog.pageType == "item"'>
WIDGET CODE GOES HERE
</b:if>

How To Show Widgets Only On Static Pages?

<b:if cond='data:blog.pageType == "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Hide Widgets On Static Pages?


<b:if cond='data:blog.pageType != "static_page"'>
WIDGET CODE GOES HERE
</b:if>

How To Show a Widget On a Selected Post Only?

<b:if cond='data:blog.url == "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>
That was all about controlling the widgets on your blogger blog.

Previous
Next Post »