To cover (or show) widgets inwards item posts, static pages, homepage or archive pages, you lot tin purpose conditional tags.
How to Show or Hide Widgets inwards Specific Blogger Pages?
Step 1. Log into your Blogger account, too hence larn to Layout. Give a championship to the HTML/JavaScript gadgets that you lot accept already added hence that you lot tin easily position the widgets that you lot accept inwards your Blogger template. Give them a unique championship hence that it does non check amongst whatever of the titles of whatever other widgets already added.Step 2. Next thing to produce is to larn to "Template" too click the "Edit HTML" button.
Step 3. Click anywhere within the code expanse too press the CTRL + F keys to opened upward the search box
Step 4. Find the HTML of the widget past times typing the widget's yell inwards the search box - striking Enter to uncovering it.
Let's tell that the championship for 1 of my widgets is "Recent Posts". After searching for the widget's name, I volition uncovering a like code inwards the template's HTML:
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<!-- alone display championship 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>
This code represents the widget/gadget that I accept added inwards the Page Elements location (Layout).
Step 5. After you've establish your widget's code, add together the next conditional tags marked amongst crimson merely earlier too later on to cover the widget from specific pages or posts inwards Blogger. For instance, if you lot want:
To exhibit the Blogger widget alone inwards Homepage
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- alone display championship 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>
To exhibit Blogger widget alone inwards post service pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<!-- alone display championship 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>
To cover Blogger widget inwards post service pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType!= "item"'>
<!-- alone display championship 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>
To exhibit the widget inwards a specific 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"'>
<!-- alone display championship 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>
Note: Replace URL of the page amongst the address of the page inwards which you lot desire the widget to appear. Please depository fiscal establishment complaint that if you lot don't accept a domain, the URL should end inwards .com, otherwise this volition non work.
To cover a widget alone inwards a item 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"'>
<!-- alone display championship 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>
To exhibit widgets alone inwards static pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "static_page"'>
<!-- alone display championship 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>
To cover widgets inwards Static Pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType != "static_page"'>
<!-- alone display championship 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>
To exhibit widgets alone inwards Archive Pages
<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "archive"'>
<!-- alone display championship 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>
Step 6. After you lot accept added the conditional tags, Save Template too sentiment your blog.
That's it!
Comments