Blogger Widgets : Statistics Widget

0 comments
Save to del.icio.us 0 hits!


Statistics Widget is a widget that shows the total number of posts & comments in your blog.

If you want to display this widget on your blog. Follow the following simple steps :


  • Go to LAYOUT Section.
  • Add this widget wherever you want to (I prefer sidebar) by choosing ADD GADGET
  • Then, from the new pop-up windows, choose Html/Javascript.
  • Now, paste the following script


<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://yourblog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>

<li><script src="http://yourblog.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul>

<noscript><a href="http://exlusivearena.blogspot.com/" target="_blank">Widgets for Blogger</a> | <a href="http://www.exclusivearena.blogspot.com" target="_blank">Blogger</a></noscript>


NOTE : Change yourblog with name of your blog.


  • Save the widget.


(If you liked my posts, please "SUBSCRIBE")

Related Posts :



Comments
0 comments
Do you have any suggestions? Add your comment. Please don't spam!
Subscribe to my feed

Post a Comment

About Me

Latest posts

Blogger Zone