Danzy World*

Great site for Computer and Internet Tricks with Entertainment FUN !

Sponsor

Propellerads

Aug 25, 2009

Total Posts and Comments Widget for blogger

Here's a cool widget for blogger, to show total number of Posts and Comments about your site.

If you have a good amount of posts and comments, you should use this widget, as it will give a good impression to your site.

How to Apply:
===========

* Login to blogger -> Dashboard -> Layout/Page Element -> Add a Gadget

* Choose HTML/Javascript

* Paste the following 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>
<font ><script src="http://danzyworld.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script>
<script src="http://danzyworld.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></font>

* Name it to what ever you like (siteinfo, statistics etc) and save it.

* That's it!

Note: Change my site url "http://danzyworld.blogspot.com" to your site url. You can also change the Total Posts: and Total Comments: text to whatever you like.


7 comments:

  1. cool
    this was what I was looking for
    will definitely do it
    thanks

    ReplyDelete
  2. it's a nice code...newly installed in my new blog..

    check out...
    http://theadamantsoul.blogspot.com/

    ReplyDelete
  3. thnks for the widget...let me try this one!!
    and thnks for ur comment!

    ReplyDelete
  4. Another good tip.ill definately try it thanks for sharing.

    ReplyDelete
  5. thanks for the great widget.its working fune in my blog...
    www.hacknol.blogspot.com

    ReplyDelete
  6. hey.. i added the code but mine is showing way less comments than the real number.. any idea why ? Is there something like Blogowners comments are not added ?

    ReplyDelete
  7. @ Dr Roshan R

    I think the problem may be with the feeds.... dont worry it will be temporarily....

    ReplyDelete

Adbox