April 8, 2014

How to Hide/Show Widgets On Specific Posts, Pages in Blogger

In many cases you will be in a situation either to hide a widget in a specific post or to show a widget only in a specific post. In such cases there’s a simple method with which you can easily hide/show widgets only for a specific post.

It is very easy to control blogger widgets from the template tab. All you need to do is just follow the simple steps that I’m gonna give you below.

Method 1: To Hide/Show a Widget On a Specific Post using Widget

If you are using a script or other widget such as Facebook Like box, Google+ sharing box or custom made subscriptions boxes then you can easily hide it using the following method.

1. Go to your blogger dashboard and click on “Layout“.

2. Click on Add a gadget from the layout window.

hide widgets on specific posts

3. Scroll down until you see “HTML/Javascript” and click on it.

hide widgets on specific posts2

To Hide the Widget
4. Paste the code as mentioned below in the widget.

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

To Show the Widget
4. Paste the code below as given.

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

5. Replace the “URL OF Selected Post” with the link of the post for which you want to show/hide the widget. Replace “Widget Code Goes Here” with the code of the widget in between the tags and hit on save. You’re done here.

hide widgets on a specific post3

Method 2 : To Hide a Widget On a Specific Post using Template

1. Open the widget and find the ID of the widget. ID is at the end of the widget’s URL.

hide widgets on a specific page4

2. Open your blogger dashboard => Template and click on “Edit HTML” button.

hide widgets on a specific page5

3. Press “Ctrl + F” and search for the widget ID.

To Hide a Widget
4. Add the code in the the template and place the widget in between the codes just like the below image.

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

hide widgets on a specific page6

To Show a Widget
4. Add the widget in between these codes given below.

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

5. You have successfully completed displaying/hiding the widget on specific blogger post.

 

About the author 

Imran Uddin


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}