Wednesday, January 5, 2011

How To Display Widget on Any Specific Post Page or Home Page Only in Blogger

Does your blog have a lot of widgets? Widget will appear on your Home page and on all your Post pages. Sometimes, this widget will slow down the loading on your page. Now you can choose to display your widget on any post page your want. You will edit this widget in the Edit HTML. So, let get started.

How to find each widget code in Edit HTML section:

Each widget have a unique title. Such as Labels, Followers, Recent Comments, etc. Each unique title is an ID to the widget which you'll find in the Edit HTML. So, to edit the widget easier, give a title for your widget.

Try to find your widget :

- Go to your Dashboard > Design > Edit HTML > Check Expand Widget Templates.

- Search this code <b:widget id=

- You will found something like this :

<b:widget id='HTML1' locked='false' title='UNIQUE TITLE OF YOUR WIDGET' type='HTML'>

Now, you can edit your widget. Let's go.


Display a Widget on Home Page Only :

Just add the red code, just like the code shown below.
<b:widget id='HTML1' locked='false' title='UNIQUE TITLE OF YOUR WIDGET' 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>

Hide Your Widget from Home Page :

Just add the red code, just like the code shown below.
<b:widget id='HTML1' locked='false' title='UNIQUE TITLE OF YOUR WIDGET' 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 != &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>

Display a Widget on Specific Post Page :

Just add the red code, just like the code shown below.
<b:widget id='HTML1' locked='false' title='UNIQUE TITLE OF YOUR WIDGET' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "SPECIFIC POST URL"'>
<!-- 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>

Hide a Widget on Specific Post Page :

Just add the red code, just like the code shown below.
<b:widget id='HTML1' locked='false' title='UNIQUE TITLE OF YOUR WIDGET' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url != "SPECIFIC POST URL"'>
<!-- 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>


Tips : If you not put the Unique title on the widget, you can still find the widget. Position of the widgets will be arranged in descending order according to your widget arrangement on the Page Element section. For example, your untitle widget located below the Recent Post widget. Then in the Edit HTML section, your untitle widget is under the Recent Post widget. Your untitle widget will appear with this code : <b:widget id='HTML1' locked='false' title='' type='HTML'/> 


Hope this tutorial useful for you guys! Good luck!

Recommend this tutorial to your friends!

Ditulis Oleh : silent screamer // 7:41 AM
Kategori:

0 comments:

Post a Comment

 

Followers

Sponsor

 
Powered by Blogger.