Posts and comments : Statistics widget for blogger

Tuesday, December 15, 2009


Your blog may contain many number of posts and comments, if you want to show the statistics then you can use this widget. The count for number of posts and number of comments will be displayed. If your blog has hundreds of posts and comments then this will be very useful.

To add this widget go to  > Layout > Add a Gadget > HTML/JAVASCRIPT  and add below code :

<script style="text/javascript">
function numberOfPosts(json) {
document.write('Total Posts: <b>' json.feed.openSearch$totalResults.$t '</b><br>');
}
function numberOfComments(json) {
document.write('Total Comments: <b>' json.feed.openSearch$totalResults.$t '</b><br>');
}
</script>

<ul><li><script src="http://bloggerflick.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>

<li><script src="http://bloggerflick.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul><noscript><a href="http://bloggerflick.blogspot.com" target="_blank">Blogger Widgets</a></noscript>

Now replace the code in red with your blog URL. Number of posts and comments will be displayed.

Subscribe to our blog

Do you have any Suggestions, add your comment. Please don't Spam!
If you like this site >> Subscribe to our feed

0 comments:

Post a Comment