Home » Blogger Tutorials, Tricks and Hacks » How To Show/Hide Widgets On Certain Pages

Welcome to our AllBlogTools.com v.3 new version, We are still in beta, please contact us to report an error.

|| View All Tutorials ||

How To Show/Hide Widgets On Certain Pages

How To Show/Hide Widgets On Certain Pages

1 Star2 Stars3 Stars4 Stars5 Stars

Report Error

2,217 views

Like one of my other recent posts, this Blogger trick has been going around the web for quite some time now, especially among experienced bloggers. But since there are still quite a number people asking how this is done, I thought I’d feature it for today’s post.

One of the reasons why you’d want to hide a widget is to avoid cramming to much stuff on your page, which distracts your visitors; you only want the relevant and essential widgets to be visible depending on the content of the current page.

So how do you do this? Just follow these steps:

  1. On your Blogger dashboard, go to Design (‘Template’ for new interface) then ‘Edit HTML’
  2. Check the ‘Expand Widgets Template’ box
  3. Search for the title of the widget you want to show/hide (press Ctrl+F). The code will look something like this:
<b:widget id='HTML' locked='false' title='WIDGET-TITLE' type='Profile'>
<b:includable id='main'>
WIDGET CODE GOES HERE
 </b:includable> </b:widget>

Once you find it, you’ll also see a line of code that looks similar to the ones I highlighted in blue. All you have to do is wrap the widget’s code with the following code below (highlighted in green):

Show widget only on Homepage:

<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
WIDGET CODE GOES HERE
</b:if>
 </b:includable> </b:widget>

Hide widget on Homepage:

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

Show widget only on Static Pages:

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

Hide widget on Static Pages:

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

Show widget on Selected Post:

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

Hide widget on Selected Post:

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

Notice the pattern? Well, now you know how it’s done. Cheers!

 

 

 

 

Liked It ? Please Share

Comments

4 Responses | Post A Comment | Subscribe To Comments RSS Feed

  1. Nice post. Thanks for this sharing. WordPress Themes gives very nice look to website.

  2. Warren says:

    Thanks, it helps :)

  3. Anke says:

    Danke für dieses tolle Tutorial, ich habe es gleich auf meinem Blog vergestellt.

    LG

  4. jayr says:

    thanks mate, ive already hide one of my widget on my homepage.

Comments will be closed off on this post 365 days (1 year) after it is published. Apologies to this, but it's all about avoiding a growing comment spam problem. See our most recent posts where you can comment here