Display Blogger widget only in home page

Usually , widgets in Blogger blogs are displayed in all pages .For eg: , look at the Get posts by email widget on my right side bar . It is displayed in all pages of my blog . Now if you want to display Blogger widget only in home page , you have to edit your Blogger template with the following strip (in blue) 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>

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(in blue) 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 ultimately you have the total control over the postion of  widgets in Blogger .

This entry was posted in Uncategorized by . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *