Friday, May 9, 2008

How to add Popular Post on Blogger

Do you want to show your readers your most popular posts? well here is the widget codes that will exactly do that.

► Under Page Elements and add a HTML/JavaScript page element
► Copy and paste the code below
► Change the line "yourblogname.yourdomain.com" with your blog site url but don't include http://



<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=1cf38ae68efbe859c4ba1ee239cec099&url=http%3A%2F%2Fyourblogname.yourdomain.com&num=10" type="text/javascript"></script>

<span style="font-size: 80%">Widget by <a href="http://blogging-for-starters.blogspot.com">Blogging for starters</a></span>



3 comments:

Lucky Girl said...

Thanks--just added this to my blog!!!

NKM said...

what are your popular posts?

Anonymous said...

@lucky girl

your welcome :)

@nabink

My blog is just a month old, at this moment I don't have enough comments so I didn't placed a popular post widget on my blog.