Spice Up Your Blogger Blog with Custom Designed Templates - BTNT Services!

How to Show and Hide Blogger Widgets On Certain Pages?

On By // 17 comments
Advertisement
How to Show and Hide Blogger Widgets On Certain Pages?
Most of the Webmasters Already Know this Tricks But still we got some requests on how to hide widgets from home page. Now we can see how to show and hide widgets in blogger. Its really important to control widget Display in Blogger. some widgets are meant for homepage only while some makes sense when you show it at your Contact Pages, About Me pages or static pages. 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.

How To Control Blogger’s Official Widgets?

This is the Procedure applied to Blogger’s official widgets like About Me, Archives, Poll etc. For controlling that widgets do this,
  1. Go To Blogger >> Design (or) Template(for new interface) >> Edit HTML
  2. Backup your template
  3. Check the Expand Widgets Templates Box
  4. Search for the title of the widget you want to control
  5. The code for the widget will look something similar to this one,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
WIDGET CODE GOES HERE
</b:includable> </b:widget>
On finding the title in place of WIDGET-TITLE-HERE you will find two similar codes like those I have shown in blueYou just need to add the Controlling codes in the following manner. For example if you wish to show a widget at Homepage only then do this,
<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>
where WIDGET CODE GOES HERE is the code of the widget you want to show or hide.


How to Hide Widgets On Homepages?

The same procedure can be applied to hide widget on homepage.
<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>

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>

That’s it. Do the same for applying any controlling code. I hope this was useful. feel free to share your thoughts through comments.

17 comments:

  1. This is very helpful.

    But I have a question.. How do you show a widget to only specific posts? For example, I only want to show "About" widget in post A and B. How do I do that? I want to show the About widget to TWO selected urls only..

    Thank you in advance and more power to you and your blog.

    Cheers!

    ReplyDelete
    Replies
    1. I already mentioned this code to show a widget on only specific posts.

      Try the below code.

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

      Replace URL OF Selected Post with the url of the page or post which you want to show the widget.

      Delete
    2. How would you only show it on two pages though?

      Delete
  2. if i dnt want to show one widget in all posts then wht should I do?

    ReplyDelete
    Replies
    1. Try the code given above "How to show widgets on selected posts?" :)

      Delete
  3. thanks for this thread..

    ReplyDelete
  4. where can i found widget code....answer please...I have a blog http://www.jobentrance.blogspot.com . Suppose I want to hide Link list..then what would be the code for this...

    ReplyDelete
    Replies
    1. You can find the code with the Widget ID (i.e. HTML1)

      Can you explain me exactly which widget you want to hide because there are many link list in your blog.

      Delete
  5. thank you for your detailed tips. some site doesn't explain good enough and I got error. Yours is better.

    ReplyDelete
  6. It doesn't work on my blogger.. It removes the widgets from ALL the pages.

    ReplyDelete
    Replies
    1. Can you give me the details how you used the code ;)

      I'll help you.

      Thanks for visiting :)

      Delete
  7. Thanks for this post... i was finding this one to show recent posts - recent jobs only on my home page
    and bank exam papers on post pages..
    It helped me
    http://abhicareer.blogspot.com

    ReplyDelete
  8. thanks bro..... i like it

    Go and check my website

    www.movie4open.in

    ReplyDelete
  9. shite shite shite none of these codes work today on widgets they only ever hide the widget totally or not at all

    ReplyDelete
    Replies
    1. I have the same issue . Any alternative ? Thanks in advance . Jaime

      Delete
  10. Nope, This codes works fine. I can't get you, Just explain what is your problem? :)

    I'll help you.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete

I Appreciate your valuable Feedback. So, Please DO NOT SPAM - Spam comments will be deleted immediately.

Don't use brand name in name field and you're not allowed to use links in comments unless it's necessary

Such Comments will be removed immediately.

Thanks,
Chandeep