Tuesday, 21 August 2012

How to Add Related Post Widget with Thumbnails to Blogger Blog

1.Log in to your Blogger Dashboard and Navigate to Layout ==> Edit HTML and checked the Expand Widget Templates Check box. Then use (CTRL+F) to find </head> in your templates.

2.Paste the code below before the closing </head> tag.

<!--Related Posts with thumbnails Scripts www.justnaira.com-->
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type="text/css">
#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding-top:5px;
padding-left:5px;
}

#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:black;
}
#related-posts a:hover{
color:black;
}

#related-posts  a:hover {
background-color:#d4eaf2;
}
</style>
<script type='text/javascript'>
var defaultnoimage="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8AVMMW-KM2El-_oD18W6WxWNAssKgQLSDcwZVZmZdeAROTCmO3yyESqcOXLw-mwk4DKvdURI5_kD1VcOXzs9pU3Fcr5dOBldRz1uETfuoZ63jixk9OLshRlNMy8oDwwV_g4CW45xSwqqt/s1600/no+Image+1.png";
var maxresults=5;
var splittercolor="#d4eaf2";
var relatedpoststitle="Related Posts";
</script>
<script src='http://olusegun-fapohunda-calculator.googlecode.com/svn/wiki/related-post-with-thumbnails.js' type='text/javascript'/>
<!-- remove --></b:if>
<!--Related Posts with thumbnails Scripts www.justnaira.com-->

3.Now find any of this code in your template:
<p class='post-footer-line post-footer-line-1'/>
Or
<div class='post-footer-line post-footer-line-1'/>
Now immediately after any of these lines (whichever you could find) place the code snippet below
<!-- Related Posts with Thumbnails Code Start www.justnaira.com-->
<!-- remove --><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>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs&amp;max-results=5&quot;' type='text/javascript'/></b:loop>
<script type='text/javascript'>
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs(&quot;<data:post.url/>&quot;);
</script>
</div><div style='clear:both'/>
<!-- remove --></b:if>
<b:if cond='data:blog.url == data:blog.homepageUrl'><b:if cond='data:post.isFirstPost'>
<a href='http://www.justnaira.com/2012/07/how-to-add-related-post-widget-with.html'><img style="border: 0" alt="Related Posts Widget For Blogger with Thumbnails" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHd0yAemEQaUAFiQCXvLfrgUzG4UFP5iWpYDOSkaWAwxhfcwpsEWEdlSiwzBDyxCf1-kwgtHV73GQEGaLkvlod3otdVjvcF8RNhFG80veLA5gwNKeTHJKwQ62OyX0fL5UEc1O0lsMH5rXC/s1600/blogger-widgets.png" /></a><a href='http://www.justnaira.com' ><img style="border: 0" alt="Blogger Templates" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY3Nma-fAFMuGOzL8fejGYY9ZtgmBCt2JHOdkh7jHfzuv6EhurozUQNf-SXANgLvjf5MTvCOykmw3EyvZlcT1j1w_v8p1l_N8fw98xskhv5UhMCcoI1blYkUCcd2GgLnAc7oxis7ycyfxW/s1600/blogger-templates.png" /></a>
</b:if></b:if>
<!-- Related Posts with Thumbnails Code End www.justnaira.com-->
4. Now Save your template.

Widget Configuration

1. To change the total no of posts displayed in your blog posts, Edit the following line of code.
var maxresults=5;

2. To Edit the title of the widget, change the following line of code.
var relatedpoststitle="Related Posts";

That's all folks.

0 comments:

Post a Comment

Your Comment Posted After Approved.