How to add Blog Statics widget

It's a simple Widget that shows to the visitor the number of Posts and comments and it's a way boast so it's recommended for big blogs cause you are not going to show the visitors that there is in the blog 3 posts and 1 comment !.


 
It's very easy to install so lets start:

Go to www.blogger.com then click on layouts like this:







Now click on any add a Gadget link(that's depend on the place you want for your widget):



















Then Choose "HTML/JavaScript" then copy this code and paste it in text box  :

<script style="text/javascript">function numposts(json) { document.write('Total Posts :' + json.feed.openSearch$totalResults.$t + '<br>'); }function numcomments(json) { document.write('Total Comments :' + json.feed.openSearch$totalResults.$t + '<br>'); }</script>
<script src="http://www.yourblog.com/feeds/posts/default?alt=json-in-script&callback=numposts"></script>
<script src="http://www.yourblog.com/feeds/comments/default?alt=json-in-script&callback=numcomments"></script>

then change the Two red url (www.yourblog.com) to your Blog's URL then click save and this is it !.

0 comments:

Post a Comment