How to add Recent Comments - Wordpress Style


Blogger does not have an inbuilt recent comments feature. So you had to revert to Google to search for the best option to display recent comments, but none of them developed it as effectively as done in wordpress. So I made this very simple widget to display recent comments in Blogger - the Wordpress Style.

So by Wordpress Style I mean that it can display up to 4 different things. They are the Comment Date, Comment Author, Post Page where Comment was done, and lastly the Comment itself. The Comment URL in the recent comments feed have some weird links like "showComment=1213409400000#comment-c6962815339210283551" which actually do not direct to the actual comment but just the Comment's post page. So the Wordpress Styled Widget does the following tasks.
The Widget makes use of the fact that in Blogger blogs any 'posturl#comments' will take you to the position on page from where the Comments start just after the Post area. So when you click on the Post Page Link in the Recent Comments you will be directed to the comments on that page and not at the start of the page. Also the Commenter's name would link to the URL provided by the commenter while commenting.

Get Your Own Recent Comment Widget - WordPress Styled


Now Log into your Blogger account and go to Layout > Page Elements
Then Click on Add a Gadget
Then Choose HTML/JavaScript
Now Copy and paste the code below into HTML/JavaScript widget.

<script style='text/javascript' src='http://corpseofattic.com/scripts/recentcomments.js'></script><script style='text/javascript'>var numposts = 5;var showcommentdate = true;var showposttitle = true;var numchars = 100;</script><script src='http://www.bloggerehow.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showrecentcomments'></script><div align='center'></div>

Note:
Change the number of posts var numposts = 5
Change to your blog URL www.bloggerehow.blogspot.com

Once you have adjusted the code according to your preferences, simply click the Save button in the HTML/JavaScript Widget.

Enjoy!


120 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Comments

Twitter Delicious Facebook Digg Favorites More