How to add Related Posts Widget For Blogger with Thumbnail
Follow the steps below-
1. Go to blogger dashboard
2. Click on the Template section of the blogger that you want to add widget
3. Now a new page appear and click on Edit HTML Button
4. And next you have to find the code
5. Find this code in template </head> After this
6. Now paste this code on above </head> tag
<b:if cond='data:blog.pageType == "item"'><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: 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; color:#5D5D5D; } #related-posts a:hover{ color:black; background-color:#EDEDEF; } </style><script type='text/javascript'>var defaultnoimage="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhon6nA_GwP28r0ASxGP1lMVGTYnCt_9WVsuslBbAL3vaaQiYKog08J5tw-jcPNbh1K-o-AHBkRih08hL8t2Zwqyq4qnDsoTEfeyvKmaeJijZkM3_zcwbtIpK1lr9NBcnXizAr1mK1lM-lv/s1600/no_image.jpg"; var maxresults=5; var splittercolor="#DDDDDD"; var relatedpoststitle="Related Posts"; </script><script src='http://helplogger.googlecode.com/svn/trunk/related-posts-with-big-thumbnails.js' type='text/javascript'/><!-- remove --></b:if>
7. Now find this code in template <div class='post-footer'> After this
8. Paste this code above of <div class='post-footer'> code
<b:if cond='data:blog.pageType == "item"'><div id='related-posts'>
<b:loop values='data:post.labels' var='label'><b:if cond='data:label.isLast != "true"'></b:if><script expr:src='"/feeds/posts/default/-/" + data:label.name + "?alt=json-in-script&callback=related_results_labels_thumbs&max-results=6"' type='text/javascript'/></b:loop><script type='text/javascript'>removeRelatedDuplicates_thumbs(); printRelatedLabels_thumbs("<data:post.url/>"); </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://mbgadget.blogspot.com/2013/08/blogger-related-post.html'><img alt='Blogger related post widget' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_cJ7b9C1CtDsu8cCW9PVhGxn8Z05lHQnzD0Sp6nRpa0ModeckvmjTlbP3D_ZkTyvGb9v_cgVcgkM-cFNjvCG8Gbc5Mfnk1fUZZh9kavy2nAhKyWWFjpYMZ06HilOFg4LkGe4piGt2s4nx/s1600/best+blogger+tips.png'/></a></b:if></b:if>
9. Now you are done and your gadget is installed successfully.
10. Just refresh the blog and its work.
METHOD 2 -
1. Find the following code in your Blogger template code
<b:includable id='post' var='post'>
2. For this tag, after a couple of lines below, there will be a closing. It might be really further down depending upon your template.
</b:includable>
3. Right before </b:includable> add the following lines of code
<b:if cond='data:blog.pageType == "item"'>
<br style='clear:both;'/>
<!--Related Posts Start-->
<style type='text/css'>
#related-posts h4{margin:5px 0 0;font-weight:bold;line-height:1.2em;font-size:16px;}
#related-posts ul,#related-posts li{overflow:hidden;padding:0;margin:0;list-style:none}
#related-posts ul{margin-top:10px}
#related-posts li{float:left;width:48%;padding:5px}
#related-posts .relimg{float:left;margin:0 5px 5px 0;padding:3px;border:1px solid silver}
#related-posts p{margin:5px 0 0}
#relloading{width:100%;min-height:150px;background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR-udM2AHl6kK-ASLcgoHYWsqaZTWin_iPQ2hJ5u8YN00V3yle5Uu5wyJ67EqBMwy-IklQVSLpN61BA1l21Cz7Mz52x0PMu-omMZIXBUvhyphenhyphens0Q2nB8clXB8I-LWyeZAtoZCTjf2ss3Ti0/s320/loading.gif) no-repeat center;display:block;text-indent:-9999px}
</style>
<script type='text/javascript' src='https://googledrive.com/host/0B9VnchIrte6hOUtZNXpXTm90TE0' ></script>
<div id='related-posts'/>
<script type='text/javascript'>
//<![CDATA[
relatedposts({
rel_title: "You May Like",
rel_posts: 4,
rel_thumb: 70
});
//]]>
</script>
<!--Related Posts End-->
</b:if>
Edits:
rel_title: Title of your "Related Posts" widget.
rel_posts: Number of related posts to display at maximum.
rel_thum: Thumbnail dimension in pixels.
It's all Done. ENJOY!

No comments:
Post a Comment