Thursday, April 23, 2009

Blog Stats [Total Posts & Total Comments] Widget





As you see above picture you will got an idea of what i am talking about.

Here is a new widget . By this widget you will be able to show your visitors your total number of POST & COMMENTS

If you want these widget than just follow these simple steps :-

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://soft-tricks-by-arham.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script>
<script src="http://soft-tricks-by-arham.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></font>



Replace the code in RED with your BLOG ADDRESS
And you may change the code highlighted in Green to modify the appearance of this widget.

0 comments: