How To Easily Display Number Of Comments On Blogger
Today am going to show you how to display number of comments on blogger,displaying number of post on blogger is almost the same thing as displaying blogger post, you can display in anywhere on your blogger eg side bar left or right, section left or right etc depending on the template your using.
Let us begin!!!!
Easily Display total comment number count in blogger
Before this post ends, We will see on how to show total number of comments and total number of posts at a time side by side.
Comment feed URL:
Atom Feed: http://www.yourblogname.com/feeds/comments/default
RSS Feed: http://www.yourblogname.com/feeds/comments/default?alt=rss
Dont forget to replace www.yourblogname.com with your site name or blogspot name.
Now, lets go straight to the tutorial:
Step 1. Go to Dashboard > Layout > Add a Gadget
Step 2. Select HTML/JavaScript gadget.
Step 3. Paste the following code below inside the widget and save:
<script style=”text/javascript”>
function commentscount(json) {
document.write(‘This Blog has <b>’ + json.feed.openSearch$totalResults.$t + ‘ Comments</b>’);
</script>
<script src=”http://www.YOURSITENAME.com/feeds/comments/default?alt=json-in-script&callback=commentscount”></script>
Don't forget to replace the YOURSITENAME in the code with your website address
and save thats all, now go to your blog home page and shoud see it displayed there
Labels: How To's
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home