In blogger some of gadgets work on homepage while some other work on static or archive pages .In default blogspot designed to show gadgets on homepage as well as in Archive/static pages also .
According to our comfort we design gadget to work on spefic page or in a archive .Want to implement a gadget in specific post page or home page here is the simple tutorial which helps you .
Note : Without proper implementation of gadget or designing of gadget like work only in archive page or home may will get disapproved from adsense . In adsense policies some gadgets should be implemented according to design of template .
Tutorial : How To Hide or show Gadgets In Home or Static Pages In Blogger
- Login To Blogger Dashboard .
- Now click on Layout section . (Note : Before editing Backup your blogger template : Click Here)
- Now click on Edit option which gadget you want to edit .
( Or )
- You can Find the specific gadget in your template .
- Just search for gadget name and you will found (For easy navigation use CTRL+F in template) .
I Want to apply Recent comments widget for this tutorial .
Example Code : Recent Comment
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now If You Want to Display This Widget Only In Home Page Add The Below Colored Lines .
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now To Display Widget In Post Pages
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now To Display Widget In Specific Page (Give The Specific UrL of The 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>
- Now To "HIDE" The Specific Widget In Specific Page
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now To Display Widget In Static Pages
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now To Hide Widget In Static Pages
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
- Now To Display Gadgets In Archive Pages
<b:widget id='HTML1' locked='false' title='Recent Comments' 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>
Save The template and Your gadget will be live on particular page .
Like and Share articles - Sharing is Caring
If you have any suggestions or errors in implementing feel free to comment below .
0 comments:
Post a Comment