+321 123 4567
info@test.com
  • Home
  • My Services
    • Web Design
    • Web Development
    • Technical Writing
  • Portfolio
  • My Thoughts
  • Free Tools
    • Photo Editor
    • Avatar Generator
    • Email Migration Tool
    • QR Code Generator
    • RSS to HTML Converter
    • Rich Text Editor
    • IP Address Geolocation
    • Base64 Image Encoder
    • NATO Translator
    • All Tools
  • Contact
Home
Blogger
Display Blogger Widget/Adsense Unit At The Homepage Only

Display Blogger Widget/Adsense Unit At The Homepage Only

Wale Adekile
October 17, 2011

Every Widget/Gadget you add in blogger automatically shows on all pages but sometimes, you might wish to have a widget appear just on the homepage only and nowhere else. If you’ve noticed, there are some page elements on this site’s homepage that won’t appear on post pages and you can do this for ads, html/javascript or any other page element. Instead of just making the widget appear on the homepage only, you can as well make it appear on a particular post page only.


How To Make Widget/Adsense Unit Appear On The Homepage Only

To do this, you need to first know your widget ID by following the steps below:

1. Log in to blogger

2. Go to Design and locate the widget you wish to appear at the homepage only

3. Right-click on the ‘Edit’ below the widget and copy link location


4. Paste the link to a notepad and locate the widget ID.

For an adsense unit, it should look like this:

http://www.blogger.com/rearrange?blogID=7243280908926933904&widgetType=AdSense&widgetId=AdSense2&action=editWidget&sectionId=sidebarleft

For a HTML/Javascript widget, it should look like:

http://www.blogger.com/rearrange?blogID=7243280908926933904&widgetType=HTML&widgetId=HTML7&action=editWidget&sectionId=sidebarleft

5. Copy out the widget ID (written in the example above in red)


6. Now go to Edit HTML and check the box labelled Expand Widget Template (I suggest you always back up your template before editing your template)

7. Press CTRL + F and find the widget ID you copied earlier.

8. In the line directly below that widget ID, you should see this piece of code:


<b:includable id='main'>

9. Immediately below this, paste the code below:


<b:if cond='data:blog.url == data:blog.homepageUrl'>

10. Now scroll down a bit (maybe 5-10 lines) till you find this code:


</b:includable>

11. Just above this, paste this code:


</b:if>

The screenshot above shows what it should look like for an HTML widget.

That’s it. Save your template and you’ll now see the widget only appears on the homepage so far you got the steps right.

How To Make Widget/Adsense Unit Appear On Blog Post URL

The process is similar to the one above but there’s a litle difference in Step 9. you only need to replace:


<b:if cond='data:blog.url == data:blog.homepageUrl'>

With this:


<b:if cond='data:blog.url == "Blog Post URL"'>

Be sure to replace Blog Post URL with the url you want the widget to appear. Save your changes and visit your blog.

How To Make Adsense Unit/Widget Display On List Pages (Homepage, Label Pages & Yearly Archive)

In step 9, use this code instead:


<b:if cond='data:blog.pageType == "index"'>

How To Make Widget Show On Post Pages Only

Use this code on step 9


<b:if cond='data:blog.pageType == "item"'>


Making Widget/ Display on Archive Pages Only


<b:if cond='data:blog.pageType == "archive"'>

Making Widget/Adsense Unit Display on Static Pages Only


<b:if cond='data:blog.pageType == "static_page"'>

Previous Post
How To Access Blocked Sites Via Proxy
Next Post
Progress / Loading / Status Bar For Firefox 4, 5, 6 & 7
Wale Adekile
Husband to the world's most beautiful woman and father to two awesome kids. A nerd, obviously; also, a technical business analyst, a web designer who preaches the gospel of WordPress, and a writer. You can check out my published books on Amazon.
BloggerBlogging Tips

How To Start A Blog – A beginners Guide

15 years ago
Blogger

How to Add Related Posts Below Your Blog Posts

14 years ago

Recent Articles

wahl rapic clip hair clipper
Wahl Rapid Clip Hair Clipper Review: DIY Made Easy
BenQ LaptopBar Review: Luxury or Necessity?
yunmai easepro unboxed
Yunmai EasePro Massage Gun Review
g20
Teendow G20 Robot Vacuum and Mop Review
bathroom
Dear Men, Spraying All Over the Toilet Seat is Disgusting and Irresponsible
winx mediatrans
How to Transfer Photos from iPhone to Computer Without iTunes
google workspace
How to Migrate Emails From Google Workspace/G Suite to cPanel
synology diskstation ds920+
Synology DiskStation DS920+ Review
playstation 4
Why I haven’t Upgraded to the PlayStation 5 Yet
pain
Started Watching Anime as an Adult? You’re Not Alone

All contents on this blog are copyright protected and cannot be reproduced on other websites without permission.

Copyright © 2022 – NerdieDad | Home | Contact | About | Privacy Policy