Tuesday, January 1, 2013

How To Show or Hide Blogger Blog Widgets On Specific Pages

Author: Gagan Masoun
How To Show or Hide Blogger Blog Widgets On Specific PagesFirst of all, May This New Year Bring Many Opportunities Your Way To Explore Every Joy Of Life. Best Wishes For The New Year 2013. When you add a HTML or other widget to your blogger blog then the widget appear on all pages – home, archive, posts and static pages by default.

In this tricky tutorial I'm going to tell that How To Show or Hide Blogger Blog Widgets On Specific Pages? or you can say How to Control Blogger's Official Widget? There are a lot of reasons you may want to only display a gadget /widget on either post page or home page because it could be anything. Suppose you created a featured slider gadget and but you wants to display it only on the blog's homepage. Follow given below steps and you can get success in this trick.

How To Control a Widget On Blogger's Specific Pages?

1. How To Display A Widget On Homepage?
Paste the HTML/JavaScript or Codes between these lines. It means gadget appear only on the homepage of your blog.

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

2. How To Hide a Widget on Homepage?
If you want to hide a widget from the homepage of blog then add your HTML gadget coding between two lines.

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

3. How To Show A Widget Only On Posts?
Show a widget only on post pages of blogger blog by adding the following coding.

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

4. How To Show a Widget On Static pages?
If you want to hide a gadget from Homepage, Post Pages then use the following code lines. It would appear only on Static Pages.

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

5. How To Show A Widget On Archive Pages?
With this widget display on archive pages and hide from other pages. Use the following code inside HTML/JavaScript widget to display a widget only on archive pages.

<b:if cond='data:blog.pageType == &quot;archive&quot;'>
WIDGET CODE GOES HERE
</b:if>

6. How To Display A Widget On Homepage and Post Pages?
If you want to show some HTML Coding on the homepage and posts of your blog then use the following coding and it would hide the gadget from Static pages.

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

7. How To Show a Widget On Homepage and Static Page?
The following code hide the gadget from posts of your site. You can show widgets on home and static pages.

<b:if cond='data:blog.pageType != &quot;item&quot;'>
WIDGET CODE GOES HERE
</b:if>

8. How To Display A Widget On Posts and Static Pages?
If you don't want to display your widgets on homepage but want to display on Posts and Static pages. Use the given below code for this process.

<b:if cond='data:blog.pageType != &quot;index&quot;'>
WIDGET CODE GOES HERE
</b:if>

How To Control Blogger's Official Widgets? 

The same procedure mentioned above can be applied to Blogger’s official widgets. It means you can simply control the Blogger's Official widgets. For Controlling widgets follow these steps:
  • Go to Blogger Dashboard > Template > Edit HTML  > Proceed. 
  • Check The Expand Widgets Templates Box
  • Search For The Title Of The Widget You Want To Control
  • The Code Might Look Something Like This One,
<b:widget id='HTML' locked='false' title='WIDGET-TITLE-HERE' type='Profile'>
<b:includable id='main'>
Widget CODE (Larger Part) 
</b:includable> 
</b:widget>
After finding the code, Now just Add <b:if> conditions just between these two tags <b:includable id='main'></b:includable>. After adding the <b:if> conditions the code will look like 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 (Larger Part)
</b:if>
</b:includable> 
</b:widget>
Now, Save the template by click on "Save Template Button". I hope this useful trick would help bloggers. Just drop your comments and suggestion. Peace and Blessings!

Author
Author - Gagan Masoun is the owner of Blogs Daddy Blog.Gagan lives in India, has been blogging since 2010 and writing Blogs Daddy Blog since 2011.You can find him in the usual social networks.

2 comments:

  1. Will this show the gadget ON my page, or in the sidebar? Thank you

    ReplyDelete
    Replies
    1. If you will choose hide option then it will not show on sidebar. You can set code according to your choice.

      Delete