Vincent Cheung

Vincent Cheung's Blog

« Newer Post Home Older Post »

Thursday, October 20, 2005

Recent Comments in Blogger

As you can see on the sidebar, I now show the most recent comments on my blog!

I'm using a hack that I found on a blog that puts the recent comments on the sidebar for Blogger/BlogSpot blogs. It's not the ideal solution, as it requires Javascript and may "break" in the future, but it does the job. I modified it a bit to suit my needs and handle the situation when the browser does not have Javascript enabled. If you want my code, just look at the page source or ask me.

I wanted a comment feed like "Princess" has. Basically what she has is a RSS feed that has all the comments on her blog so that you can see when people post new comments. Then, using some sort of RSS reader (read my previous post on this), you can instantly see the new posts and comments on her blog. Blogger doesn't do this and I couldn't figure out a nice and easy way to do it, but at least now you can see what new comments have been posted.

Update (Oct. 21, 2005):  after some javascript hacking, I got "More..." to show up under "Recent Columns" that will show all the comments for all the posts in the current view.


Sarah said...

recent comments on the sidebar is amazing!

i dont get why comment rss isnt standard yet. it just makes sense.

but either way, i think listing recent comments on the mainpage is crucial. especially if people are commenting on more than just the most recent post.

Alan Howard said...

Hey Vince, your hack is great! However, in trying to implement it on my site, I'm finding a bit of a problem... I was wondering if you could have a look at it and see if you can correct my mistake? I've basically cut and paste the same coding you have, and put it in the same places you've got it, but I get a completely different result... what am I missing?


Vince said...

I reworked the code quite a bit in order to better integrate with the "show/hide" comments thing. I think you're missing the appropriate labels on your posts and comments and the code that actually calls the recent comments code. Here's the link to my template and you can check it out for yourself. Warning though, it's a bit of a mess, as I've really only had my blog for a week and a half and just threw these "features" together.

Lica said...

ei there.. I came across your site when i was searching google on how to show recent comments on the sidebar. Would it be okay if i asked you for the codes? I really like the way you did it. Please? :) thanx.


Vince said...

Just take a look at the template link I gave in the comment above yours.

Jeff Day said...


This is cool, but if you want a really easy all-in-one Comments Feed and Recent Comments sidebar solution, which only requires one line of javascript in your template, you should check out the one here.

Anonymous said...

Hi, I know you posted this up ages ago. but is there anyway that you could send me the code (and instrxns a newbie could follow) on how to get REcent Comments to show on my site?
I've tried a bunch of routes, html, and am basically screwing something up.
Much appreciated

Vince said...

This hack doesn't work for Blogger Beta. You can get recent comments to show up by adding an rss feed module to the sidebar and using the comment feed for your blog as the feed.

Andytgeezer said...

Hi Vince

Hope you don't mind but I put your what and why links into my blog

Thanks for the inspiration and help. I've sorted it now.

Andy mischief

Post a Comment