On right hand side column of this blog traffic tips blog you can see total number of posts and total number of comments.
How to show total number posts and/or total number of comments on your blogger blog ?
Here is script to show total number of posts and comments . You have to add this java script
by going to Dashboard > Layout > Add a gadget > HTML /Java script
Then copy following java script .
Please change blog url from www.blogtraffictips.net to yourname.blogspot.com in the following script.
<script src="http://www.blogtraffictips.net/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp"></script>
<script style="text/javascript">
function numberOfPosts(json) {
document.write('Total number of Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<script src="http://www.blogtraffictips.net/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script>
<script src="http://www.blogtraffictips.net/feeds/comments/default?orderby=published&alt=json-in-script&callback=rp"></script>
<script style="text/javascript">
function numberOfComments(json) {
document.write('Total number of Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<script src="http://www.blogtraffictips.net/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script>
The first half can be used to display only total no. of posts and second half can be used to display only total no. of comments.
9 comments:
Great! Thanks for sharing this script widget, this is exactly what I need. Thanks for sharing and I'll try it out for myself.
Southern California website design
Thanks for your nice tips. I love your blog.
Blogger Tips
Thanks for your nice tips. I love your blog.
Blogger Tips
Thanks :)
Thanks for this widget...I'm having a problem with it though. I have had it up for a few months and then all of the sudden it is showing incorrect numbers for my comments. My comments are around 800, and it is only showing 81. I've tried removing it and adding it back on, but it isn't resolving the problem. Any ideas what could be the issue?
hai there..this widget is not working in my blog..why??
thanks the widget works fine for my blog
www.hacknol.blogspot.com
Thank you I'll give it a try ASAP and if it works I'll re-comment on the script.
thanks for script :D
Post a Comment