How To Show The Widgets Only On Homepage of The Blogger Blog

In Blogger earlier I had faced many issues with widgets. If you place a widget in home page it will be visible to all the web pages. Most of the time I frustrated about that, but now I have clear idea about how to resolve this issue. Because I got some experience about blogger blog. This blogger trick will help you to show widgets only in homepage.

Generally I wants to place many widgets on my home page, even though I don't want to show those widgets in my post pages. This will be more annoying both me as well as my blog visitors.

The below steps will help you to place widgets only in blogger homepage.

Step 1: Log in to blogger blog

Step 2: Open Template section and Click Edit Template.

Step 3: Search widget that you want to show only in homepage.

I do show you one example here - Popular Post

Expand widget and it will look like below. After <b:includable tag use the highlighted code. You need to give the condition. If data:blog.url == data:blog.homepageUrl means your widgets only visible in homepage.

<b:widget id='HTML1' locked='false' title='Popular Post' 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:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

Step 4: Save your template and refresh your pages.

You need to make sure that you are using right code. You need to use <b:if cond='data:blog.url == data:blog.homepageUrl'> this code.

Thank you!!!

No comments:

Post a Comment