Many of the user currently using widget by linkwith for showing related post by category or labels.
There is another method also to show the related widget in blogger itself without any external widget like linkwith.For this blogger hack you just need to change few codes of your blogger code and everything will be fine.
1.First of all Login to your blogger dashboard and navigate to Layout > Edit HTML and check the "Expand Widget Templates" check box
2.Now look for
/head
Replace it with
<!--Related Posts with thumbnails Scripts and Styles Start-->
<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: 1.6em;
font-weight: bold;
color: black;
font-family: Georgia, “Times New Roman”, 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 src='http://www.box.net/shared/79ad7y9i56' type='text/javascript'/>
</b:if>
<!--Related Posts with thumbnails Scripts and Styles End-->
</head>
4. Now Find below code
<div class='post-footer-line post-footer-line-1'>
5. paste the below code just after the step-4
<!-- Related Posts with Thumbnails Code Start-->
<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>
<b:if cond='data:blog.pageType == "item"'>
<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:if></b:loop><a href='http://howtoraj.blogspot.com/2009/09/related-post-with-thumbnail-widget.html' style='display:none;'>Related Posts with thumbnails for blogger</a><a href='http://www.howtoraj.blogspot.com/' style='display:none;'>blogger widgets</a>
<script type='text/javascript'>
var currentposturl="<data:post.url/>";
var maxresults=5;
var relatedpoststitle="Related Posts";
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div><div style='clear:both'/>
</b:if>
<!-- Related Posts with Thumbnails Code End-->
Note if you dont find the footer code don't worry, you may use after <p><post.body>Here.......Just replace the 'Here' with the step-5 code.
6. You may adjust the maximum number of post by
var maxresults=5;
Change number 5 to any other number
7. You may change the title of related post widget by changing this
var relatedpoststitle="Related Posts";
Just Link this post if you really find this post Interesting
No comments:
Post a Comment