How to display total comment count in Blogger

·

Displaying total number of posts and comments in blogger let your visitor know how many post you get on your page and likewise the total number of comments. It is important to show you visitors the total number of your posts and comments. You can display the total number of comments and posts on the sidebar or on any desirable place on your page.
At the end, you will know how to show up total number of post and comments all together.

From your page you will see ATOM FEED or RSS FEED right click on it and copy the link out, and it will look like

Atom Feed: http://www.yourblogname.com/feeds/comments/default
RSS Feed: http://www.yourblogname.com/feeds/comments/default?alt=rss


Replace that http://www.yourblogname.com with your own site name.

Now follow this steps:


  1. Go to Dashbord => Layout =>Add a gadget then
  2. Click on HTML/JavaScript gadge.
  3. The paste this code in HTML/JavaScript gadget:

<script style="text/javascript">
function postscount(json) {
document.write('Total Posts: <b>' + json.feed.openSearch$totalResults.$t + ' posts</b><br/>');
}
function commentscount(json) {
document.write(' Total Comments: <b>' + json.feed.openSearch$totalResults.$t + ' Comments</b>');
}
</script><script src="http://www.YOURSITENAME.com/feeds/posts/default?alt=json-in-script&callback=postscount"></script><script src="http://www.YOURSITENAME.com/feeds/comments/default?alt=json-in-script&callback=commentscount"></script>

4. Please replace YOURSITENAME with your site name
5. Save the widget and your template then view the number of posts and comments on your blog page.

0 comments:

Are you confused or just want to tell us you visited? Feel free to comment

Your feedback is always appreciated. I will try to reply to your queries as soon as time allows.

Thinking of spamming here?:
Please do not spam Spam comments will be deleted immediately upon our review. So why waste your time?

Regards,
Enoch

Kindly use this button below to get this my article on your computer:

Print Friendly and PDF

You can also read this Related Posts



Best Blogger Tips

Post a Comment

Join me on Facebook Follow me on Twitter Follow me on Digg Follow on BlogCatalog Follow me on MySpace Subscribe to RSS Email me

Blog Archives

Google+

Google+

Followers