How to Show and Hide Blogger Widgets?

 


Blog Widgets can be sorted differently using Blogger Conditional tags. There are some widgets in the blog that only need to be shown on the tune page, while there are some widgets that only need to be shown on the home page. To do this you need to use Conditional tags in Blogger Widgets. Many people think that the question arises, how to show the Blogger Widget only on the Home Page? How do I show Blogger Widget only on Sub Page? How to show Blogger Widget only on Static Page? How do I show the Blogger Widget only on a specific page? Today we will discuss in detail the answer to each of these questions, InshaAllah.

How to Show and Hide Blogger Widgets?

How to Show and Hide Blogger Widgets?

Conditional tags are very important for sorting and controlling Blogger widgets. Blogger Widgets can be customized by customizing these small Conditional tags.

How to do?

  • Login to your blog first.
  • Then click on Template> Edit Html.
How to Show and Hide Blogger Widgets?

How to Show and Hide Blogger Widgets?
  •  Then press Ctrl + F from the keyboard to find each Html tag. Expand the codes and you will see exactly as below.

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code 

  • In the widget above, I am showing the “latest tune” widget of my blog as an example. This widget of my blog will not show on the home page, but you can see it on any tune page

Code tag contact:

  1. 'Item' here means only the tune page.
  2. Here 'Index' means Homepage and Search / Label Pages.

01. Widgets to show on Homepages only:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

02. To hide from Widgets Homepages:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

03. Widgets to show only in Static Pages:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

04. To hide from Widgets Static Pages:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

05. Widgets to show only on certain pages:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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!= ""'>

<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>

Copy the code

06. Widgets only to hide from certain pages

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

07. Widgets to show only on the first page of home pages

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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!= ""'>

<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>

Copy the code

07. Widgets to show on Index Pages only:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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!= ""'>

<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>

Copy the code

09. To hide from Widgets Index Pages:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

10. Widgets to show on Search Pages only

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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!= ""'>

<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>

Copy the code

11. Widgets to show in Mobile Browsers only:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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!= ""'>

<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>

Copy the code

12. Widgets to show in Computer Browsers only:

<b: widget id = 'HTML4' locked = 'false' title = 'Last Tune' 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>

Copy the code

  • After adding each new Conditional Statement, you must save the Blogger Template.

 

 

Post a Comment

أحدث أقدم