Tuesday, 2 April 2013

How to Show and Hide Blogger Widgets On Certain Pages

Leave a Comment
How to Show and Hide Blogger Widgets On Certain Pages
Widgets are applications added to blogs or websites. Widget apps are used to enhance blogs by giving them extra content beyond simple text-based blogging. Embedded slideshows, search bars and music players are just some of the many widgets available to bloggers. While some users enjoy the added functionality, widgets don't appeal to everyone. To read a blog without the bells and whistles, you can open up a post without extra widgets.

  1. Go To Blogger > "Template" > "Edit HTML".

  2. Backup your template.

  3. Check the "Expand Widgets Templates" box. Search for the title of the widget you want to control

  4. The code for the widget will look something similar to this one:

  5. <b:widget id='HTML1' locked='false' title='Profile1' type='HTML'>
    <b:includable id='main'>
    
    Widget Code Here
    
    </b:includable>
    </b:widget>

    For example if you wish to show a widget at Homepage only then do this:

    <b:widget id='HTML1' locked='false' title='Profile1' type='HTML'>
    <b:includable id='main'>
    <b:if cond='data:blog.url == data:blog.homepageUrl'>
    
    Widget Code Here
    
    </b:if>
    </b:includable>
    </b:widget>

  6. After you have found your widget's code, add the following conditional tags below to show and hide the widget from specific pages or posts in Blogger.

  7. How To Show Widget Only On Homepage
    <b:if cond='data:blog.url == data:blog.homepageUrl'>
    
    Widget Code Here
    
    </b:if>

    How To Hide Widget On Homepage
    <b:if cond='data:blog.pageType == "item"'>
    
    Widget Code Here
    
    </b:if>

    How To Show Widget Only On Static Pages
    <b:if cond='data:blog.pageType == "static_page"'>
    
    Widget Code Here
    
    </b:if>

    How To Hide Widget On Static Pages
    <b:if cond='data:blog.pageType != "static_page"'>
    
    Widget Code Here
    
    </b:if>

    How To Show Widget Only On Archive Pages
    <b:if cond='data:blog.pageType == &quot;archive&quot;'>
    
    Widget Code Here
    
    </b:if>

    How To Hide Widget On Archive Pages
    <b:if cond='data:blog.pageType != &quot;archive&quot;'>
    
    Widget Code Here
    
    </b:if>

    How To Show Widget On A Selected Post
    <b:if cond='data:blog.url == "URL Of Selected Post"'>
    
    Widget Code Here
    
    </b:if>

    How To Hide Widget On A Selected Post
    <b:if cond='data:blog.url != "URL Of Selected Post"'>
    
    Widget Code Here
    
    </b:if>

  8. Now "Save" your Template.

0 comments :

Post a Comment

Related Posts Plugin for WordPress, Blogger...