Portal of all Blogger widget, Airtel USSD Codes, Facebook Hack, Free Internet Tips, PC and Blogger Tricks

Breaking

Wednesday, 6 November 2013

Hide/Show widget on Home Page| Display /hide widget on specific pages inBlogger

Here is the answer for all questions related to show or hide gadgets. Here you will get answer for questions like: How to Show widget on home page only... Or hide it. And many more..
Before I teach you this one..Check Another Cool Blogger Tricks
Now continue with Hide/Show widget  or Gadget in blogger on Page/Post...

  • Step 1. Go to Blogger’s Dashboard >
  • Layout. See Title Of Any Gadget.
  • Step 2. Now Go To Template.
  • step 3. Click.on "EDIT TEMPLATE".
  • Step 4. Find the widget’s title in the HTML by using Ctrl+F and entering the widget’s name in the search box.

Let’s say that the title for one of my
widgets is “Recent Posts. After searching for the widget’s name, I will find a similar code in my template:
<b:widget id=’HTML1′
locked=’false’ title=’Recent
Posts‘ type=’HTML’>
<b:includable id=’main’>
<!– only display title if it’s non-empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:includable>
</b:widget>
This code represents the widget or gadget that I have added in the Page Elements location (Layout).

Step 5. After you’ve found your widget’s code, add the following conditional tags marked with red just below and above to hide the widget from specific pages or
posts in Blogger.
For instance, in case you want:

To show the widget only in Homepage:

<b:widget id=’HTML1′locked=’false’ title=’Recent Posts’ type=’HTML’>
<b:includable id=’main’>
<b:if cond=’data:blog.url ==
data:blog.homepageUrl’>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

To show Blogger widget only in post pages

<b:widget id=’HTML1′
locked=’false’ title=’Recent Posts’
type=’HTML’>
<b:includable id=’main’>
<b:if
cond=’data:blog.pageType ==
“item”‘>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

To show the widget in a specific page

<b:widget id=’HTML1′
locked=’false’ title=’Recent Posts’
type=’HTML’>
<b:includable id=’main’>
<b:if cond=’data:blog.url ==
URL of the page“‘>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

Note: Replace URL of the page with the address of the page in which you want the widget to appear

To hide a widget only in a particular page

<b:widget id=’HTML1′
locked=’false’ title=’Recent Posts’
type=’HTML’>
<b:includable id=’main’>
<b:if cond=’data:blog.url !=
URL of the page”‘>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

To show widgets only in static pages

<b:widget id=’HTML1′
locked=’false’ title=’Recent Posts’
type=’HTML’>
<b:includable id=’main’>
<b:if
cond=’data:blog.pageType ==
“static_page”‘>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

To hide widgets in Static Pages

<b:widget id=’HTML1′
locked=’false’ title=’Recent Posts’
type=’HTML’>
<b:includable id=’main’>
<b:if cond=’data:blog.pageType !=
“static_page”‘>
<!– only display title if it’s non-
empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

To show widgets only in Archive Pages

<b:widget id=’HTML1′ locked=’false’ title=’Recent Posts’ type=’HTML’>
<b:includable id=’main’>
<b:if cond=’data:blog.pageType ==
“archive”‘>
<!– only display title if it’s non-empty –>
<b:if cond=’data:title != “”‘>
<h2 class=’title’><data:title/></h2>
</b:if>
<div class=’widget-content’>
<data:content/>
</div>
<b:include name=’quickedit’/>
</b:if>
</b:includable>
</b:widget>

Step 6. After you have added the conditional tags, Save Template and view your blog.

If you face any problem...dont hesitate to tell us. Plz Comment.. it is important.

No comments:

Post a Comment

Notice: Don't add "backlink". Text with Link will automatically Removed.