Creating Popular Posts Based on many comments on blogs

Leave a Comment
This is made using a javascript function to display the most popular posts based on the most commented on an article on your blog.
to find out how, please follow these steps:

  1. Log in to your blogger account
  2. Choose a Page Element --> Add a Gadget --> HTML/JavaScript
  3. Copy the code below
<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ul 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('</ul>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=a7d3195528df5e96181a3d2712266226&url=http%3A%2F%2Fscriptexample.blogspot.com&num=10" type="text/javascript"></script>
<a href="http://asal-klik.blogspot.com/2010/03/creating-popular-posts-based-on-many.html" target="_blank"><span style="font-size: xx-small;">Popular Posts Widget</span></a>

Note:
Replace the bold text "scriptexample.blogspot.com" with your blog address without using http://
Replace the bold number "10" to set the number of posts that will appear on your blog on

0 comments:

Post a Comment