About

Labels

slider

Recent

Navigation

Show or hide widgets in post,pages or home

Been a long time blogging, but a few queries sometimes get stuck in a corner of mind.I usually thought that Blogger can't provide those facility that are provided by other hosting (like Wordpress).The control of widgets through out different posts,pages or home can be a difficult task for anyone but a little snippets can get you out from that.Make sure that these snippets will work only in HTML template editer in Blogger not in layout>widget sections.These snippets can be usable for style that I've discussed in my past post.So lets see how to control widgets on home,posts and static pages.


So lets get start

how to show on home page only?

<b:if cond='data:blog.url == data:blog.homepageUrl'>
WIDGET CODE GOES HERE
</b:if>
replace the widget code.

How to Hide Widgets On Homepages?

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

procedure is same as above

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>

How To Hide a Widget On a Selected Post?


<b:if cond='data:blog.url != "URL OF Selected Post"'>
WIDGET CODE GOES HERE
</b:if>

Note: These snippets will work only in template editor,so don't add them in layout>widget sections.
Share
Banner

Muhammad Hamza

Themelet provides the best in market today. We work hard to make the clean, modern and SEO friendly blogger templates.

Post A Comment:

0 comments: