Step 1: Go to Design > Edit HTML tab and find for:
<div id='main-wrapper'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</div>
Step 2: Add the following snippet before the closing DIV. It is </div> marked in bold in step 1.
I have used the conditional tags highlighted in red to show these sidebar sections only in homepage of your blog. If you want these widget sections to be shown also on post pages then delete the conditional tags.<b:if cond='data:blog.url == data:blog.homepageUrl'><b:section class='sidebar' id='col-left' showaddelement='yes' />
<b:section class='sidebar' id='col-right' showaddelement='yes'/>
<div style='clear: both;'/>
</b:if>
Step 3: Find ]]></b:skin> and before this add:
#col-left {
width: 48%;
float: left;
}
#col-right {
width: 48%;
float: right;
}
Step 4: Save you template and go to Blogger “Page Elements” tab. You will find that there are two widget sections added just below the post body. Now add some widgets to these and view your blog.
One more thing you will notice that the sidebar columns will be visible after the blog pager and blog feed links. Blog-pager links are “Older Post”, “Home” and “Newer Post” links and blog-feed links are “Subscribe to: Posts (Atom)” and “Subscribe to: Post Comments (Atom)” links that are visible in Blogger homepage and in item pages below every posts.
If you think that it looks bad then you can hide or remove these links so that the two sidebar widget sections will appear only after the post body. So let’s do another step.
Step 5 (Optional): Go to Design > Edit HTML tab and find for “]]></b:skin>”. Immediately below it add the following styling properties:
Again note that here also I have used the conditional tags for homepage only. At last save you template.<b:if cond='data:blog.url == data:blog.homepageUrl'><style type='text/css'>
#blog-pager {
display:none;
}
.feed-links {
display:none;
}
</style>
</b:if>
It’s done.
Hi Raju,
ReplyDeleteThanks for sharing this codes. Can you share the code to add the share buttons on the left column and related posts on the right column, just like the one you have it here.
Thanks :)
Firstly - I want to show that widget in Blogpost URL not in the Home page URL . So, I added this code "b:if cond='data:blog.url == data:post.url'" instead of yours "b:if cond='data:blog.url == data:blog.homepageUrl'" . But it saves in the "Edit Html" Tab but show error in the "Page Element" Tab . The "Page Element" Tab shows "Post.url" not found !! Please tell me - How can I show this widget in Post URL only not homepage ?
ReplyDeleteSecond - I want to show this widget in "Post-footer-line-2" not under "Subscribe to:" or "Page Number" . I tried it with "Expand widget mode" but it shows error !! Now how can I add this widget under "Post-footer-line-2" ??
Waiting for your quick reply ...........
Sorry to not to give a quick reply as I was having problem with net connection.
ReplyDeleteHowever, try "<b:if cond='data:blog.pageType == "item"'>" which is for post pages.
Hi Raju ...
ReplyDeleteI have a problem implementing this code. Whatever I do, I just cannot get the widgets to appear side by side. They always appear one below the other. What do you think could be the reason. I have tried changing the width values to fixed pixels. but that doesn't work either. Hope you can help!
Have you tried adding any gadget to it and then view your blog in browser? From Design > Page Elements tab it will show a long bar for adding the widgets but when viewing it in browser, it should work properly for layout templates.
ReplyDeleteIf you are still getting any problem, leave a reply, I will check it.
Thanks for replying so quickly Raju. Yea I have tried that. My blog URL is http://travellingwindmills.blogspot.com
ReplyDeleteI have added two placeholder widgets - blog stats, and search. As you can see they are stacked and not side by side.
Thanks in advance!
Okay, it seems that you're using HTML5(Blogger's new templates from Template Designer). As I've told earlier that this tutorial is for Layout templates only. For the type of template you are using, the whole HTML and CSS part will be different and I've to write another tutorial for it and it needs some time. :(
ReplyDelete:( ... anyway thanks Raju ... do let me know if you happen to write another tutorial ... because I have searched and searched and looks like nobody has written one for new templates. Thanks again..
ReplyDeletei can't find the above code in my template,how can do this..
ReplyDeletemy blog url is:http://digitalchannels.blogspot.com
You have already added it!
ReplyDeletehow to do related post n sosial bookmarking like urs? im interested with that.. the related post automatik change to another related post.. can tell me the hacks? :)
ReplyDeleteOkay, I was thinking to write about it and I will surely do.
ReplyDeletethanks Raju.. i waiting for ur post bout that.. :)
ReplyDeleteHello hi Amanda,
ReplyDeleteI want adding a column ...you can help me ???
thanks you
thanks you
thanks you
images demo :http://i1209.photobucket.com/albums/cc392/desunvn/untitled-1.jpg
First, my name is not Amanda.
ReplyDeleteSecond, contact me by email.