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.

Post Bottom Ad

Pages