How to Show and Hide Blogger Widgets?

Widgets can be sorted in a variety of ways using blogger Conditional tags. There are some widgets on the blog that only need to show on the post page, but there are some widgets that only appear on the home page. To do this, you need to use Conditional tags in Blogger Widgets. Many people wonder how the blogger widget will show in the Home Page? How to Show Blogger Widgets Only in Sub Page? How to show Blogger Widget only in Static Page? How to show Blogger Widget only on a specific page? Today we will discuss the answers to each of these questions, Insha Allah
Show and Hide Blogger Widgets
Conditional tags are important for sorting and controlling Blogger widgets in various ways. Blogger Widgets are customized to customize these small Conditional tags.



 How to do

  • Login to your blog first.
  • Then click on Template> Edit HTML.
Show and Hide Blogger Widgets
  •  Then press Ctrl + F to search every HTML tag. Expanding the code will look like the following.
<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<!-- 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:includable>
</b:widget>
  • In the above widget, I will show the "last post" widget of my blog as an example. This blog on my blog will not show on the home page, but you can see it on any post page.
Code Tag Contact:
  1. Here 'item' means only post page.
  2. Here 'index' means Home and Search / Label Pages.

 01. Widgets to show only on homepages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' 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>

 0. To Hide Widgets From Homepages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' 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>

 03. Widgets to show only in Static Pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' 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 != &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>

 

04. To Hide Widgets from Static Pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' 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 != &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>

 05. Widgets to show only in certain pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "URL of Selected Post"'>
<!-- 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>

 06. Widgets to hide only specific pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url != "URL of Selected Post"'>
<!-- 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>

 07. Widgets to show in the first page of Home Pages only:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:post.isFirstPost'>
<!-- 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>

 08. Widgets to show only on Index Pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "index"'>
<!-- 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>

 09. To Hide Widgets From Index Pages:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType != "index"'>
<!-- 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>

 10. Widgets to show in Search Pages only:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.searchLabel'>
<!-- 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>

 11. Widgets to show only in Mobile Browsers:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.isMobileRequest == "true"'> 
<!-- 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>

 12. Widgets to show only in Computer Browsers:

<b:widget id='HTML4' locked='false' title='সর্বশেষ পোষ্ট' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.isMobileRequest == "false"'>
<!-- 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>
  • After adding every new Conditional Statement, you must save the Blogger Template.

Post a Comment

0 Comments