Saturday, September 17, 2011

Add Beautiful related post(You Might also like this) Below Every Post

Here is a beautifil code to add a related post below every post.

Steps To Follow:


Step1:Go To Blogger design > Open Edit HTML >
Click on Expand Widget Templates.


Find </head> tag


Step2: Past Below Code just above </head> code.




<!--Related Posts with thumbnails Scripts and Styles Start-->

<style type='text/css'>

#related-posts {
float:center;
text-transform:none;
height:100%;
min-height:100%;
padding:5px;
}

#related-posts h2{
color:#73CFFA;
font-size: 14px;
font-weight: bold;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
}

</style>
<script type='text/javascript'>
var defaultnoimage=&quot;https://lh5.googleusercontent.com/-s6drIJfS9sQ/TnOQRtpzRvI/AAAAAAAABbY/W6_Xtav9dFk/s800/noimage.gif&quot;;
var maxresults=7;
var splittercolor=&quot;#FF0000&quot;;
var relatedpoststitle=&quot;Related Posts&quot;;
</script>
<script src='http://blogergadgets.googlecode.com/files/related-posts-with-thumbnails-for-blogger-pro.js' type='text/javascript'/>
<!--Related Posts with thumbnails Scripts and Styles End-->

Step3: Now find 

<data:post.location.name/></a>
          </b:if>
        </b:if>
      </span> </div>
    </div>  


Step4: Paste the below code right after the above tag



<!-- Related Posts with Thumbnails Code Start-->



<div align='center' 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=6&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'/>
<!-- Related Posts with Thumbnails Code End-->

Step5: Save The Template.


Note:
1: Here you can change you Default Thumbnails by Replacing This Image With Your one.

https://lh5.googleusercontent.com/-s6drIJfS9sQ/TnOQRtpzRvI/AAAAAAAABbY/W6_Xtav9dFk/s800/noimage.gif






2: You can change Header color by changing The red Marked color code

#related-posts h2{
color:#73CFFA;
font-size: 14px;
font-weight: bold;
font-family: Georgia, &#8220;Times New Roman&#8221;, Times, serif;
margin-bottom: 0.75em;
margin-top: 0em;
padding-top: 0em;
}



3: You Can change the Number of posts to be displayed by changing the below number
var maxresults=7;


4: You Can change the header name of related post by changing the below code


var relatedpoststitle=&quot;Related Posts&quot;;


from blogergadgets

No comments:

Post a Comment

Previous Page Next Page Go Home
back to top