Connect with us

How To Show Widgets/Gadgets Only On The Home Page In Blogger | Conditional Tags

How To Show Widgets/Gadgets Only On The Home Page In Blogger

Blogger

How To Show Widgets/Gadgets Only On The Home Page In Blogger | Conditional Tags

On Blogger if you add a widget, by default it is shown on all the pages, and sometimes it becomes unnecessary to display all the widgets on each page. You can use the conditionals tags to restrict gadgets to specific pages in Blogger.

In this tutorial we will guide you step-by-step to how to show Blogger widgets or gadgets only on the homepage.

 

Step 1:

  • Sign in to your Blogger.
  • Click Theme.
  • Click Edit HTML to insert conditional tag. If you have updated your Blogger then click three vertical dots at top-right corner to Edit HTML.
How To Show Widgets/Gadgets Only On The Home Page In Blogger | Conditional Tags

 

Blogger Templates

 

  • Click “Jump to widget” icon at bottom of Theme to open the code of the widget.
How To Show Widgets/Gadgets Only On The Home Page In Blogger | Conditional Tags

 

Choose the widget from the list. Remember that custom widgets will not be listed by their name, they will be listed by Id like HTML1, HTML3 etc, but once you click a gadget from the list you will see “title” of the widget along Id, so you can identify the widget from its title like this:
  • <b:widget id=’HTML5′ locked=’false’ title=’Deals&Promos’ type=’HTML’ visible=’true’>
How To Show Widgets/Gadgets Only On The Home Page In Blogger | Conditional Tags

 

Step 2:

Once you click the widget the starting line of widget will be at top. Widget body starts from the line like this:

  •  <b: widget id=’HTML3′ locked=’false’ title=’Deals &amp;amp; Promos’ type=’HTML’>
How To Show Widgets/Gadgets Only On The Home Page In Blogger
  • Now slowly scroll down till you reach the line:
  • <b:includable id=’main’>…</b:includable>
  • Now click on the black arrow to expand the code if it is already not expanded.
How To Show Widgets/Gadgets Only On The Home Page In Blogger
  • Now you can see that the body has been expanded.
How To Show Widgets/Gadgets Only On The Home Page In Blogger
  • Now Paste this condition: 
  • <b:if cond=’data:blog.url == data:blog.homepageUrl’>
  • Below this line <b:includable id=’main’>
  • To close the condition Paste </b:if> in between <b:include name=’quickedit’/> & </b:includable>
  •  Like:

<b:include name=’quickedit’/></b:if>
</b:includable>

  • Widget body ends at </b:widget>
How To Show Widgets/Gadgets Only On The Home Page In Blogger
  • Now Save the theme.
  • Go to website and see whether the widget is appearing on the other pages or not.

 

  • I  added following two lines(bold).

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

  • Get access to all the Blogger Tutorials.
  • If you like this post then don’t forget to share with other people. Share your feedback in the comments section below.

 

Recommended Posts

 

Meer Basit is the founder of Meer’s World. He’s been running the show since launching the blog back in 2018. By background he is a computer scientist. Primarily, he creates content around blogging (WordPress, Blogger, Tumblr), SEO, affiliate programs, earn-online, reviews, eCommerce, & technology. He has got years of professional experience in web programming, computer programming, databases, data warehousing, & transcription. In general, he likes traveling, gardening, watching movies, is a passionate cricketer, creative writer, and a GSD lover.

2 Comments

2 Comments

  1. -

    July 27, 2020 at 3:33 pm

    Yours is an excellent blog. Keep carrying on with this good work.

Leave a Reply

Your email address will not be published. Required fields are marked *

More in Blogger

To Top