How to Show Blogger Links,Widgets in HomePage Only or Post Page Only
Posted by kranthi on Wednesday, March 11, 2009This post explains how to show the Blogger widgets( like links,adsense ads,etc) on your blogspot blog Homepage Only or Post Page Only:
Usually, by default.. when we add a widget item
like link units, profile, Archives, Adsense ads,Pictures,etc in Blogger blog , it will be displayed in every page of the blog including the homepage, Permalink pages,etc. As you can see, I installed many widgets in this blog in sidebars like Google ads, Donate Me button ,etc which will be displayed in all the pages of the blog.
But, what if you want to display a specific widget like a blog link,ads in only the homepage and not in the post pages and viceversa? If you want to do so, this tip will come in handy...
HOMEPAGE Only widgets,links in Blogger:
→ As usual, if you want to add a new widget/gadget to your blog, just Sign into Blogger dashboard » Layout » Add a Gadget
and select the type of gadget you need and Save the Changes.
Next, we have to add a small piece of code to that widget, so.. it only displays in the Homepage. Just go to Edit html and tick on the 'Expand Widget Templates'.
Notes: Normally, the widgets in the template view starts with this one
<b:widget id=
For example, The label widget looks something like this:
<b:widget id='Label1' locked='false' title='Title' type='Label'>
and html widget looks like:
<b:widget id='HTML1' locked='false' title='' type='HTML'>
and link list looks like this:
<b:widget id='LinkList2' locked='false' title='Title' type='LinkList'>
(If you want to know exactly what the widget id you need to change, just go to your blog and view the source code and find it.
In Firefox : View » Page Source
In IE : View » Source )
Just below that widget id link, You can see a b:includable tag like this..
<b:includable id='main'>
At this point, most of the task is completed.. Just we have to add a small piece of code below that b:includable tag..
the code isand the last thing is, we have to close that b:if tag. Just add this code before the closing tag of b:includable.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
Like this:
</b:if>
</b:includable>
So, the final code looks similar like the below screenshot:
That's it! and Don't forget to Save the Changes.
Now, your desired widget/gadget can only be visible in Homepage.
Showing in only Post Pages (Permalink pages):
This will allow you to show a specific widget in only the Post Pages and not in the Homepage.
Just follow the same tutorial above but replace this code.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
with this one:
<b:if cond='data:blog.pageType == "item"'>
Showing Widgets on a Specific Blog Post url:
If you want to dispaly a specific widget on on a particular blog post, just simply follow the above tutorial, but replace this code:
<b:if cond='data:blog.url == data:blog.homepageUrl'>
with this one:
<b:if cond='data:blog.url == "Blog Post URL"'>
That's it!
Like this post or have any questions? Comment here..
© Blogger Tricks








42 comments:
Good post, thaks. :)
Thanks for showing it so clearly. I really like the included screen shot, that helps a lot.
Your templates are gorgeous
Do you have an example for it?
yu re templates re awesom!!! do try somthin specific to computers
Informative.appreciated.
This is a great post--thank you!
I have an additional question though:
If you want to show the sidebar only in the homepage and not in post pages, what should one do?
I tried using your solution, and indeed the texts and widgets do not show in post pages anymore, but the background color of my sidebar still remains.
I tried using the b:if code in #sidebar-wrapper and .sidebar widget, but it messes up the template.
Thanks!
that's a great post - thank you!
i have an additional question though:
what if you only want to show the sidebar in the homepage and not the post pages?
with your solution, the texts and page elements in the sidebar indeed disappear in the post pages, but the sidebar background color gets left behind.
i tried applying the b:if code in #sidebar-wrapper and .sidebar widget, but it messes up the lay-out.
thanks for your help!
-jennie
Thanks so much for the info. :)
ITemplatez.com offers professional flash templates, Swish Templates , web design templates, Logo Designs , and Wallpapers...
That was very useful.. Thanks very much.
I was in search of exactly this thing..
You have made it easy to understand with the help of images.
hi, can u tell me wht is the meaning of this
(Scheduled outage at 4:00PM PDT on Thursday (3/25)this error is comming in my dashboard.
@ eyeglasses4u,
Hi, that's not an error. It is showing on all blogger dashboards..
What that mean is.. the blogger (google) server will be temporarily down on that time.
Hi, I have a small problem and i didn't know how to contact U to ask about it,..
How can I add a code in Blogger(New Post) with out activating it?
Thanks, My email is "selviaayman@gmail.com"
Shen Ellith
Thanks Kranthi. I was looking for it, and it really helped me a lot.
Mohit
It's Working with everything instead of adsense code which i require most. I've seen another blog but that will require me to modify adsense code which is not allowed. Any solution?
Mohit
This didn't work for me and I don't know why.
Thank you very much.
I can do it.
nice post
Great post! I am definitely going to use this.
Just used this trick to my blog - http://netblot.blogspot.com
thanks and more power!
thats amazing and great..
thanks for this tips..
marvelous ............ and just to say my blog has the remove the get widget button hack and i am using it for that sake.
http://gamespump.blogspot.com
Great Tip, I was not sure if you could do this in Blogger. It sure would be handy if Google would add a button to select this option to their widget. Anyway, it was just what I needed for my Site,
Golf Tip Reviews, http://www.golftipreviews.com
Thanks Again.
HI,WHEN I ADD NEW POST THEN IT SHOWS ON MY HOMEPAGE,SO HOW CAN I ADD NEW POST WITHOUT LOOKING ON HOMEPAGE.I WANT TO JUST ON MY LABEL.PLZ HELP ME.KAOSAR
thanks a lot , its working
http://data4experts.blogspot.com
thanks your tips.so very good
nice one buddy..
implemented it successfully on d shoutbox in my blog...
http://downloadsnhacks.blogspot.com/
thnxx again..
Hey,
I was searching for this tip for a lot of time. I googled and found several others. But yours is a good explanation. But i still have the same doubt as somebody pointed out, HOW DO WE HIDE THE SIDEBAR. It still shows when i hide the gadgets. Please tell me a solution! Get a look about Windows knowledge on my blog. Technology Blog
nice post... tq for posting... nice tricks.
It's very useful. Thanks for sharing.
how to show specific post on home page
I'm your fan!
I just wanted to say this was a fantastic article. I recently submitted to a ton of directories and didn't want to give them exposure on every page. For the help I will be happy to add your own link to http://www.mightybuying.com
I need help really bad, now come across you which is pretty good. Just like yours, you have homepage, Blogger template, I want to add contact link in there, but where to write my contact page?How can I add contact link and when visitors click on that, it will load display my contact page. Please help me. You can have a look my blog:http://hotgirlscollection.blogspot.com/. Please be mind the adult content. Thanks.
@ Gerardy,
Looked at your blog..seems like you already found solution :)
Exactly what I was looking for, thanks.
The only problem is that while the contents of the widgets aren't displayed, the widget itself is (if that makes sense). I mean if you have borders around the widget for example, they will still show.
Can't get it to work ... is someone willing to take a look at the widget coding I did to maybe see what I have done wrong? I'd be happy to email it. Many thanks!
Really thanks for this tip...
Awesome, thanks for this!
that was perfect.. thanks for the tip..
I have read the same instructions from another site, and have changed my code accordingly, but cannot get my top widget (custom html widget w/video and chat) to only appear on my front page...it still appears at the top of every page!i have checked and double checked to make sure I am selecting the right code and entering the correct new code, and have even put my code with the tutorial side by side and they are exact. Still on every page though!
What am i doing wrong??
nevermind, fixed it!