Popular Or Most Commented Posts Widget For Blogger - Helper Blogger

Blogger Widgets | Templates | Tutorials


Thursday, 23 February 2012

Popular Or Most Commented Posts Widget For Blogger

Show off your most popular posts and at the same time prevent them from being buried in the archive -using Popular Post widget.
This time we will be making a Popular Posts widget for Blogger blog. The popularity rank is based on the number of comments each post receives. The comment counts are extracted from your blog’s latest 1000 posts, using a Yahoo! Pipe.Now lets see how to add this widget to blogger.

How To Add Most Commented Posts Widget To Blogger?

  • Go to Design > Page Elements.
  • Click Add A Gadget link.
  • Select HTML/Javascript gadget.
  • Enter the title of your widget e.g. Popular Posts.
  • Copy and paste the code inside the content box.
  • Save and view your blog.

<!-- Popular posts with comment count Start -->
<script type="text/javascript">
function getYpipePP(feed) {
document.write('<ol style="">');
var i;
for (i = 0; i < feed.count ; i  )
var href = "'"   feed.value.items[i].link   "'";
var pTitle = feed.value.items[i].title;
var pComment = " \("   feed.value.items[i].commentcount   "\)";
var pList = "<li>"   "<a href="  href   '" target="_blank">'   pTitle;
document.write(pComment); //to remove comment count delete this line
<script src="http://pipes.yahoo.com/pipes/pipe.run?
<span style="font-size: 80%; float:right;"><a href="http://www.helperblogger.com/" target="_blank">Make your own</a></span>
<!-- Popular posts with comment count End -->

Some Customization

  • Replace highlighted http://www.helperblogger.com with your blog URL.
  • If you want show the less number or more number of posts then find this line ShowHowMany=10 and change the value 10.
  • If you want to delete comment count then find this line document.write(pComment); //to remove comment count delete this line and delete it.

Making your own pipe (Optional)

If you want further customize the widget output, you need to edit the (Yahoo) pipe itself. Follow the steps below:

  • Go to the Yahoo! pipe.
  • Log in to your Yahoo! account.
  • Create a clone by clicking the Clone button.
  • Click edit source to edit it in anyway you like.
  • When you’re done editing and saving, test run it by clicking Run Pipe button to confirm the output of the pipe.
  • To use your edited pipe, copy the pipe Id and paste it to replace the existing id in line 22. (To get the Id, look in your browser’s address bar. It is the end part the url when you are viewing or editing the pipe.)


1 comment:

  1. popular post widget is the best way to gain some traffic for some late and popular posts of the blogs.such widget also helps to reduce the bounce rate of the blog because user stays on the blog for long time and hence it helps to increase traffic and visibility of the blog.thanks for sharing with us.Aashiqui 2 ringtones


If you want to be informed about any replies then check "Notify me" option (present at lower right corner of comment box and it will display if you are logged in to your google account). PLEASE DO NOT SPAM