Saturday, March 07, 2009

How to display total posts and comments of your blog

This is you have to do if yiu want to show your post and comments statistic at your blog.

How to show your Total comments and total posts from your blog?
Copy Scripts below in the place where you want to show. Don't forget to replace the "Red Text" into your blog name.

Total Posts Script:

<script style="text/javascript">
function showpostcount(json) {
document.write('Total Posts : <b>' + parseInt(json.feed.openSearch$totalResults.$t,10) + '</b><br>');}</script>
<script src="http://namablog.blogspot.com/feeds/posts/default?alt=json-in-script&callback=showpostcount"></script>


Total comments script:

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


Copy and paste those script and happy blogging my friends :)
And backup your template first to prevent from bad situation.

3 comments:

  1. do you have a sample of this just so i have a better picture of how the "Total comments and total posts" will look like? :)

    ReplyDelete
  2. Aku coba masukan dalam scrip blog saya, tapi ngak bisa-bisa tuh. apa yang salah ya

    ReplyDelete

While comments maybe u would like to download another Blogger Templates Or Tricks ?? :)

Handphone Protector

handphone is the stuff that is always attached in your pocket. This m obile is a common item , but that does not mean it is not w...