How To Add Popular Post Widget – without comments count

Posted by Lasantha Bandara File Under : gadget, post, widget 4 Comments

1.Login to your dashboard--> layout- ->Page Elements

2.Click on 'Add a Gadget' on the sidebar.

3.Select 'HTML/Javascript' and add the code given below and click save.

<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%2FYOURBLOG.blogspot.com&num=10" type="text/javascript"></script>

Note : Remember to replace YOURBLOG with your blog name.Also you can change 10 to show different number of popular posts.

Now you are done.

4 thoughts on “How To Add Popular Post Widget – without comments count

  1. Is this based on no. of comments per post or no. of views per post?

    Also, does it take time to start showing the results?

    Regards,
    Kaddu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.