Awesome Total Posts and Total Comments widget for Blogger and WordPress blogs. - latest tech tips

Ad Spot

Place your Ads here!

Post Top Ad

Awesome Total Posts and Total Comments widget for Blogger and WordPress blogs.

Share This
Most of the visitors you get daily are first timers. It is very essential for them to get impressed at the first sight as there is no second chance in the cyber world. One of the ways to impress could be displaying the total number of posts and comments on your blog.

Total posts gives the user information as to the amount of content in your website and no of comments gives the reader an impression as to how much your content is credible the more comments the better. Displaying them manually can be very painful so I came up with a very simple copy paste code which would allow you to add this info in your blog very easily.

Before you do the trick it is very important that your blog is enabled for RSS feed. If not this trick is not useful as it uses your RSS data to get the total posts and comments in your blog. Now all you have to do is:

Add total posts and comments for Blogger Users:
1. Go to Blog Design
2. Add Widget > HTML
3. Copy-paste below code in the HTML widget and place it anywhere on the page preferably at the bottom.


<script style="text/javascript"> 
function totalPostsInMyBlog(json) { 
document.write('<b>' + json.feed.openSearch$totalResults.$t + '</b>'); 
} 
function totalCommentsInMyBlog(json) { 
document.write('<b>' + json.feed.openSearch$totalResults.$t + '</b> '); 
} 
</script> 
<div style="position: fixed; top: 120px; right: 5px;">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" align="middle">
<font color="black"><b>Posts </b></font></td>
</tr>
<td height=64 width=64 background="http://cdn5.iconfinder.com/data/icons/OxeSet/Board.png" valign="middle" align="middle">

<font size="+1" color="white"><script src=" /feeds/posts/default?alt=json-in-script&callback=totalPostsInMyBlog"></script> </font></td>

<tr>
<td valign="middle" align="bottom">
<font color="black"><b>Comments </b></font></td>

<tr>
<td height=64 width=64 background="http://cdn5.iconfinder.com/data/icons/OxeSet/Board.png" valign="middle" align="middle">

<font size="+1" color="white"><script src=" /feeds/comments/default?alt=json-in-script&callback=totalCommentsInMyBlog"></script> </font></td>

</tr>
</tr></table>
<div></div></div>

 
4. Now check for the preview if you are satisfied just save the settings and you are all set.
5. In case you are not very happy with the placement then you can change the location bu changing the below code.


<div style="position: fixed; top: 120px; right: 5px;">

 

Add total posts and comments for Wordpress User:
1. I have never used word press but the code is generic.
2. Just place the code Step # 3 from above in your blog somewhere in the body of your word press blog and it should work.


The advantages of this total post and total comments widget are:

1. It utilizes the empty side space in your blog.
2. It can be used without modifying any code.
3. Very easy to install takes less than 30 seconds to activate it.
4. With very minor code change it can be easily configured.

9 comments:

  1. Such tools help greatly in improving the quality of the site and the users get a better impression.

    ReplyDelete
  2. I am not sure how much quality it improves, but definitely the impression of the website can be judged based on the total comments..

    ReplyDelete
  3. this is cool! definitely helpful.

    ReplyDelete
  4. Hey thanks Vee, I am happy to know that you found it helpful..I hope you use it in your blog..

    ReplyDelete
  5. Sounds like a very useful widget - I'll give this one a go, thanks for posting.

    ReplyDelete
  6. AnonymousMay 06, 2011

    HI,
    I've tried the widget for this trick but unfortunately the comments does not update and i dont know how to fix it...
    Do you have any idea about how to fix this problem???
    Please i really want this widget it's very nice for my blog!!

    Please pay a visit http://the-blog-gr.blogspot.com

    ReplyDelete
  7. I saw it on your blog and I could see everything working fine..The total posts on your blog are 340 and comments 73.

    Let me know if you are still facing the same issue I will fix it for you no worries.

    ReplyDelete

Spam comments will be deleted. Only comments which add value to the blog and its readers will be published.

Post Bottom Ad

Pages