Thursday, January 15, 2009

Popular Post Widget-Most commented Posts Blogger

Popular Post Widget i.e Most commented Posts for blogger as is very great widget to show of your posts,which your readers most liked and expressed there love in comments.You will love to use this widget in your blog for sure.It is very easy to install just have to add small bit of javascript codes to your blog sidebar.

How to install this widget:-

Go to Layout > Add page Element > Html/Javascript

Add the below code there


<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ol style="text-transform: capitalize;">');
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write('</ol>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=1cf38ae68efbe859c4ba1ee239cec099&url=http%3A%2F%2Fanshuldudeja.blogspot.com&num=10" type="text/javascript"></script>
<noscript><a href="http://anshuldudeja.blogspot.com" target="_blank">Blogger Hacks</a></noscript>


Change the code in red above with the your blog name and in green to show how many posts you want to display and please don't remove he credit's.Now save it.

Using above codes will show total no of comments in front of posts if you dont wanna show them use below codes


<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ol style="text-transform: capitalize;">');
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write('</ol>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=1a1c6e4e6d4f148e3650fda46910e15f&url=http%3A%2F%2Fanshuldudeja.blogspot.com&num=10" type="text/javascript"></script>
<noscript><a href="http://anshuldudeja.blogspot.com" target="_blank">Blogger Hacks</a></noscript>


I hope you will like this widget for sure Enjoy !!!

Credits To Divya Sai.Visit his blog for sure as his blog is also the good source for blogger widgets.

No comments:

Post a Comment