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.
See the demo in Blogger Sentral Widget Showcase.
Without further ado,
- Go to Design > Page Elements.
- Click Add A Gadget link.
- Enter the title of your widget e.g. Popular Posts.
- Copy and paste the code inside the content box.
- Save and view your blog.
Replace the value of
YourBlogUrl in code line 20 from http://www.bloggersentral.com to your own blog URL. Don’t include the slash (as in .com/).
Style the list with the inline style attribute in line 4.
Selecting the options
- Number of posts -the default number of posts on display is 10. You can set it to show how many posts as you like by changing the value of
ShowHowManyin code line 21.
- Comment count - comment count for each post is displayed as default. To remove comment count, delete code line 13.
- List style -the default is numbered list. To change to bulleted list, replace o
l(in line 4 and 16) with u
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.)