12 January 2010

Related Posts/Similar Posts widget for blogger


We already have Related Posts/Similar Posts widget WITH thumbnail for blogger. It includes the thumbnails  of image in that post. But we are here now with a simple but attractive Related Posts/Similar Posts widget without thumbnails.

UPDATE : Now we have two different Styles and methods to add Related Posts widget.


Take a look here Live Demo

It can work with LinkWithin Related Posts widget.
So lets add this to your blog.

1. Login to blogger > Layout > Edit HTML > Download Full template (for backup) > Expand Widget Templates.

2. Now look for </head> . And add the following code ABOVE it.

<!--Related Posts Scripts and Styles Start-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
#related-posts {
#related-posts .widget{

#related-posts .widget h2, #related-posts h2{
font-size: 1.6em;
font-weight: bold;
color: black;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
#related-posts a{
#related-posts a:hover{
#related-posts ul{
margin:0 0 0px 0;
#related-posts ul li{
background:transparent url(http://2.bp.blogspot.com/_tbHfaj1A058/S0cIGtxWTMI/AAAAAAAAIWs/naYwvQOLV28/s1600/xxz.gif) no-repeat ;
margin-bottom: 4px;
padding-left: 15px;
padding-top: 0px;}
<script type='text/javascript'>
var relatedpoststitle=&quot;Related Posts&quot;;
<script src='http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt' type='text/javascript'/>
<!--Related Posts Scripts and Styles End-->

Again apply your styling skills to change color, margin. You can also change the bullet image. You can change Related Posts Title to your own here
var relatedpoststitle="Related Posts";

3. Finally look for

<div class='post-footer-line post-footer-line-1'>


<p class='post-footer-line post-footer-line-1'>

And add following code BELOW it.

<!-- Related Posts Code Start-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast != &quot;true&quot;'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;max-results=6&quot;' type='text/javascript'/></b:if></b:loop><a href='' style='display:none'/>
<script type='text/javascript'>
var currentposturl=&quot;<data:post.url/>&quot;;
var maxresults=5;
removeRelatedDuplicates(); printRelatedLabels();
<!-- Related Posts Code End-->

You can change the number of related posts shown by changing value

var maxresults=5;

It's done. So method 1 ends here.



So lets add this to your blog.

1. Login to blogger > Layout > Edit HTML > Download Full template (for backup) > Expand Widget Templates.

2. Now look for </head> . And add the following code ABOVE it.

Download Code

3. Now look for

And add this code BELOW <data:post.body/>

It's done. You can change this

    text size='2'>Related Posts From Category:

And no. of posts to be shown can be changed here max-results=5  

Also check new Related Posts widget for blogger (based on Labels)

Related Posts


May 24, 2010 at 3:32 AM

Thanks a lot for this widget. I've been anxiously searching for it.

Perhaps, I am a little afraid to use it because the code is lengthy & that it could make some severe unwanted changes to my blog. But i'll have to use this widget to strengthen my internal linking

Thanks again

May 27, 2010 at 4:57 PM

I had the second option here working just fine on my blog, but then I got my design changed and now it doesn't work anymore. Can you help me out?

August 31, 2010 at 10:51 PM

@drraman 1st one not working with the linkwithin.

PLease help me out..

September 1, 2010 at 12:40 AM

(a) Jobsplanet

It works. As shown in demo.

I think use any one related post widget.

May 3, 2011 at 8:28 AM

Thanks for this friend its totally a big help! It works well on my site! check here... http://pinoytvchannel.blogspot.com

October 12, 2011 at 4:17 PM

Thanks for this related posts widget. I already add this to my Computer tips and tricks blog. One last question how to remove the "tags" that showing after the "Related Posts:" ?

October 13, 2011 at 12:03 AM

Welcome Rommel Ismail

You are using Method 2


<b:loop values='data:post.labels' var='label'><data:label.name/>

from Step 3 code

Post a Comment


Twitter Delicious Facebook Digg Stumbleupon Favorites More