Total Number of Posts and Comments - Blogger Gadget

Posted by All in One Solution on 8:40 AM with No comments
Here's another simple widget for your blog. With this widget, you can show your live stats (total posts and comments on your blog).
You may change the phrases "Total Posts" and "Total Comments" and the color of the font too.
Follow these instructions to add a similar widget to your blog:
Log in to Blogger, go to "Layout", click on "Add a Gadget", and select it as "HTML/JavaScript" type. Now add this code to the widget:

<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>
<font color="red"><script src="http://bloggerstop.net/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script>
<script src="http://bloggerstop.net/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></font>

Replace the code in red with your blog's address.
And you may change the code highlighted in blue to modify the appearance of this widget.
Categories: