What is Statistics Widget for Blogger?
Statistics Widget for Blogger will display the total number of posts and total number of comments on your blog.
How to install Statistics Widget for Blogger
01. Go to your blogger blog navigate to blogger Design tab, Add a Gadget, select HTML/JavaScript and paste the following script with your blog name (your_blog_name). Now save it.
<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://your_blog_name.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>
<li><script src="http://your_blog_name.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul>
That's it. You have created a widget to display the number of posts and number of comments on your blog.
Credit : Widgets for Blogger
0 comments:
Post a Comment