12 January 2010

Related Posts/Similar Posts widget for blogger

Advertisements

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.

METHOD ONE
------------------

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;'>
<style>
#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding-top:2px;
padding-left:5px;
}
#related-posts .widget{
padding-left:6px;
margin-bottom:10px;

}
#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{
color:#006699;
}
#related-posts a:hover{
color:#003366;
}
#related-posts ul{
list-style-type:circle;
margin:0 0 0px 0;
padding:0px;
text-decoration:bold;
font-size:15px;
text-color:#000000
}
#related-posts ul li{
background:transparent url(http://2.bp.blogspot.com/_tbHfaj1A058/S0cIGtxWTMI/AAAAAAAAIWs/naYwvQOLV28/s1600/xxz.gif) no-repeat ;
display:block;
list-style-type:none;
margin-bottom: 4px;
padding-left: 15px;
padding-top: 0px;}
</style>
<script type='text/javascript'>
var relatedpoststitle=&quot;Related Posts&quot;;
</script>
<script src='http://sites.google.com/site/freebloggerhelpbiz/freebloggerhelp/relatedposts.txt' type='text/javascript'/>
</b:if>
<!--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'>

or


<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>
<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();
</script>
</div>
</b:if>
<!-- 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.


METHOD TWO
----------------------

http://1.bp.blogspot.com/_tbHfaj1A058/S7BUxmbshtI/AAAAAAAAJpQ/HRNVG_X78m4/s1600/related+posts+FREE+BLOGGER+HELP.JPG

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
<data:post.body/>

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

8 comments

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

Remove

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

from Step 3 code

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More