How to Add Related Posts Widget to Blogger with Thumbnails

Related posts widget is the most popular way to display similar related links below posts area. This is a simple hack to add some CSS and script code to display the related posts with thumbnails. With this hack many readers remain on your website for longer periods of time.


Add Related Posts Widget to Blogger with Thumbnails


Steps:  Add the Related Posts widget to Blogger.


Step 1. Go To Blogger Dashboard > Template > Edit HTML


Step 2. Search (CTRL + F) below tag.




Step 3. Copy and paste the below code above </head> tag


<!--Related Posts with thumbnails Scripts and Styles Start-->
<!-- remove --><b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type='text/css'>
#related-posts {
#related-posts h2{
font-size: 18px;
letter-spacing: 2px;
font-weight: bold;
text-transform: none;
color: #5D5D5D;
font-family: Arial Narrow;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
#related-posts a{
border-right: 1px dotted #DDDDDD;
#related-posts a:hover{
<script type='text/javascript'>
var defaultnoimage=&quot;;;
var maxresults=5;
var splittercolor=&quot;#DDDDDD&quot;;
var relatedpoststitle=&quot;Related Posts&quot;;
<script src='' type='text/javascript'/>
<!-- remove --></b:if>
<!--Related Posts with thumbnails Scripts and Styles End-->


More than 5 posts to change the  (var maxresults=5) above code


Step 4. Now Find the following line.


<div class='post-footer'>


Step 5.  Paste the below code above this tag (<div class='post-footer'>)


<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;'>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs&amp;max-results=6&quot;' type='text/javascript'/></b:loop>
<script type='text/javascript'>
</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=''><img alt='Blogger Tricks' src=''/></a>


Step 6. Now Save the template and see the changes.

comments powered by Disqus