December 29, 2010

How To Show Popular Posts (Most Commented Blog Posts)

Popular posts are your most commented blog posts. Showing off your popular posts is definitely a way to keep visitors longer, one of the displayed post might have gone into archive but still pretty much relevant. Who knows, some of your visitors might still be in need of it.

Displaying popular posts on your blogspot site needs no special HTML knowledge and you don't even need to edit your template html manually. Follow the steps below and implement any of the given codes on your blog depending on your taste:

1. Login to your blog and click on "Design"

2. Depending on where you want to display this widget, click on "Add a Gadget"




3. Select HTML/JavaScript



4. To display the posts in this format

My Blog Post A (10 comment)
My Blog Post B (9 comments)
My Blog Post C (8 comments)


<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=ML4p0UfW3RGgS7iN1JzWFw&url=http%3A%2F%2FYOUR_BLOG_ADDRESS_WITHOUT_HTTP://&num=7" type="text/javascript"></script>

<a href="http://www.doncaprio.com" target="_blank"><span style="font-size: xx-small;">Popular Posts Widget</span></a>



To display in this format:

My Blog Post A (10)
My Blog Post B (9)
My Blog Post C (8)


<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=28a6afad7c6ba1288c1b738277e42385&url=http%3A%2F%2FYOUR_BLOG_ADDRESS_HERE_WITHOUT_HTTP://&num=7" type="text/javascript"></script>

<a href="http://www.doncaprio.com" target="_blank"><span style="font-size: xx-small;">Popular Posts Widget</span></a>




To display without number of comments like this:

My Blog Post A
My Blog Post B
My Blog Post C



<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=097d1b822fc6f356d8376802a911036b&url=http%3A%2F%2FYOUR_BLOG_ADDRESS_WITHOUT_HTTP://&num=7" type="text/javascript"></script>

<a href="http://www.doncaprio.com" target="_blank"><span style="font-size: xx-small;">Popular Posts Widget</span></a>



5. The number "7" shown in blue determines the number of posts that will be shown. You can change to whatever number you like.

Also, make sure you completely replace the area in the code shown in red with your blog's address without "http://"!

The widget works perfectly and if it doesn't, I suggset you take a look at your blog address in the code.




Stay Connected With Free Updates

Subscribe via Email

7 comments:

stock tips says:

It was a awe-inspiring post and it has a significant meaning and thanks for sharing the information.Would love to read your next post too......
Thanks
Regards
Stock Tips

Share Tips says:

It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.

Share Tips

john says:

thanx for this tutorial post & html script.its so much useful to me.

sellnfl says:

I wanna say something,especially if I read a post that really grabs my attention. However, I won’t do it for the sake of doing it.wholesale soccer jerseysI just think that I really like in your article point of view.

Fiverr says:

A very good blog of various systematic criteria that we clarify doubts over life!Your so cool! I dont suppose Ive learn something like this before. So good to find any individual with some authentic thoughts on this subject. http://imakemoneywithfiver.com/

Fiverr says:

I like the helpful information you provide for your articles. I’ll bookmark your weblog and check again here frequently. I am quite sure I’ll learn many new stuff proper here! Best of luck for the following!http://www.youtube.com/watch?v=f1B_RHw57C8

eagles513 says:

physical activity is any Cheap Steelers Jerseys form movement that causes your body to use enegy. it may be purposeful. such as when you exercise or play sports. it may also occur as part of your regular routine, for example,as you are walking or riding bike to go to school,Aaron Smith Jersey you are doing the physical activity. many forms of physical activity can improve your physical fitness, the ability to carry out daily tasks easily and have enough reserve energy to respond to unexpected demands. maintaining a high level of physical fitness gives you a sense of Ben Roethlisberger Jersey total well-being and is an important lifelong health goal.
Official Eagles Jerseys
Eagles Throwback Jerseys
Kids Eagles Jerseys
Womens Eagles Jerseys

Post a Comment

100% Uptime, Unlimited Space, Unlimited Bandwidth