How to show/hide any widget in blogger

How to show/hide any widget in blogger –

Every blogger want show or hide some widget from homepage or any static page ? In case you should not add adsense ads in your  static pages it violate adsense rule. so you have to hide ad from static page. but normally blogger all widget show all post pages and static pages. That’s why I am going to share how to show or hide any widget from blog homepage or static page or archive page?   If you want any widget hide or show on any particular page you have to add two small pieces of code with your widget code.

How to hide any widget from Homepage?

If you wish to hide any widget from homepage. Copy below code then replace this line ‘YOUR WIDGET CODE’ with your widget code and paste it in your widget area. Now your widget successfully hidden from homepage it will show only post pages and static pages.

<b:if cond=’data:blog.pageType == “item”‘>

YOUR WIDGET CODE

</b:if>

How to show widget only on homepage?

<b:if cond=’data:blog.url == data:blog.homepageUrl’>

YOUR WIDGET CODE

</b:if>

How to show widget only on archive page ?

<b:if cond=’data:blog.pageType == &quot;archive&quot;’>

YOUR WIDGET CODE

</b:if>

How to hide widget from archive page ?

<b:if cond=’data:blog.pageType = &quot;archive&quot;’>

YOUR WIDGET CODE

</b:if>

How to hide widget on static page?

<b:if cond=’data:blog.pageType != “static_page”‘>

YOUR WIDGET CODE

</b:if>

How to show widget on static page?

<b:if cond=’data:blog.pageType == “static_page”‘>

YOUR WIDGET CODE

</b:if>

How to show widget on selected posts?

<b:if cond=’data:blog.url == “URL of Selected Post”‘>

YOUR WIDGET CODE

</b:if>

How to hide widget on selected posts?

<b:if cond=’data:blog.url = “URL OF Selected Post”‘>

YOUR WIDGET CODE

</b:if>

How to do this on blogger official widget –

Now if you want to hide or show blogger official widget like Attribution, popular posts, navbar, recent posts.

Login Blogger >> Dashboard >> Template >> Edit Template

Go your preferred widget section, you can find your widget by widget ID. Now your widget code will look like this.

<b:widget id=’HTML’ locked=’false’ title=’WIDGET TITLE’ type=’Profile’>

<b:includable id=’main’>

LARGE WIDGET CODE

</b:includable>

</b:widget>

Now paste code like below example.

For example if you hide widget from homepage just do like this –

<b:widget id=’HTML’ locked=’false’ title=’WIDGET TITLE’ type=’Profile’>

<b:includable id=’main’>

<b:if cond=’data:blog.pageType == “item”‘>

LARGE WIDGET CODE

</b:if>

</b:includable>

</b:widget>

 

It’s done.

Friends I hope this tricks will really help you to hide or show any widgets without any problem. In this code implementation if you get any trouble leave a comment below.  Happy Blogging

Rate this post

Leave a Reply