Display Blogger widget only on homepage



Usually, widgets in Blogger blogs are displayed in all pages. Now if you want to display Blogger widget only in home page, you have to edit your Blogger template with the following strip (<b:if cond='data:blog.url == data:blog.homepageUrl'>) of code. Here is HTML2 is my widget id for “Get posts by Email“. There may be different ids for different widgets.

In each case, <b:if cond='data:blog.url == data:blog.homepageUrl'> should be added to make them fixed to the home page.

<b:widget id='HTML2' locked='false' title='Get Posts By Email' 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 != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
    <data:content/>
  </div> 
 </b:if>  <b:include name='quickedit'/>
</b:includable>
</b:widget>
</div>

Open your blogger templates layout and then edit HTML.

Click on expand widget templates. With Ctrl+F search for each widget with its ids or given label.
Now paste the code as specified and save your template. The edited Blogger widget would appear only in the homepage.
Note : You can display Blogger widget in all pages except home page by altering above code (<b:if cond='data:blog.url == data:blog.homepageUrl'>) with this one.
<b:if cond='data:blog.pageType == 'item''>

Or you can display a Blogger widget only in a particular post page by changing it with following code.

<b:if cond='data:blog.url == 'blog post URL''>

So you have the control over the postion of widgets in Blogger
Related Posts Plugin for WordPress, Blogger...

Please, don't include pam.

Leave a Reply

© 2011 Template For Blog. WP Themes by Skatter Tech. Bloggerized by Bambang Wicaksono.
Scroll down for Next Widget
 
BLOG MENU
Go
to
Top