Recent Comments
Purpose
This plugin displays a list of the most recent comments to your blog in a highly customisable way.
This is version 2.5.0
. It is compatible with WordPress 1.5–2.5.
Please note the new upgrade instructions!
- 2.5.0 introduces a new output tag {imagesrc}, and adds more parameters to {image}. Fixes bugs with empty categories, excluded posts, and the option to omit current posts.
- 2.5b25 makes some important changes: the {image} output tag now serves real thumbnails (couple of bug fixes too); output can now be sorted as you choose with sub-headings included; the {date:raw} tag modifier has been added to help the sorting; the ‘trim_before’ option has been replaced with the more logical ‘divider’.
- 2.5b24 fixes to stop recursive replacement by content filter, {gravatar} to allow for ‘identicon’ etc., to {commenter} to allow trimming, and to remove a warning in safe mode
- 2.5b23 brings a new option to filter on custom fields and adds proper nesting of braces in {if}.
- 2.5b22 fixes bugs in several output tags, and introduces two new options: to show only pages and to omit comments by registered users.
- 2.5b18 fixes a filtering problem and introduces the conditional tag, {if:condition:yes:no}.
- 2.5b16 fixes a problem with {php}.
- 2.5b15 more bug fixes and added ‘included posts’ setting.
- 2.5b14 continuing bug fixes.
- 2.5b11 has new features and improvements.
- 2.3.6 restores the widgetiness I managed to remove in 2.3.5!
- 2.3.5 has been rebuilt to save memory and can match the current post’s tags. It also fixes a bug with categories in WordPress < 2.3.
- 2.3.4 can be used as a WordPress widget. Also can include or exclude the current post from the output.
- 2.3.3 beta adds the ability to include as well as exclude categories and authors and is able to find posts by tag.
- 2.3.2 beta fixes a conflict between tags and categories and grouping bug introduced in 2.3.0.
- 2.3.1 fixes a stupid bug in category exclusion
- 2.3.0 is compatible with WP 2.3
- 2.1.1 fixes a bug when recent_comments() is used more than once on a page
The plugin has an settings page which lets you change how the output is generated and displayed.
Installation Instructions
- If upgrading from a previous version, first deactivate the plugin via the Plugins page and delete the plugin folder from your server.
- Upload the plugin folder to your /wp-content/plugins/ directory. You will also need to install the Post-Plugin Library.
- Go to your admin Plugins page and activate Recent Comments.
- Put
<?php recent_comments(); ?>at the place in your theme files where you want the list of similar posts to appear. Lorelle on WordPress has a good guide to modifying themes for plugins. If you are using a widget-ready theme the plugin can be placed from the widget admin page. - Use the admin Options|Recent Comments page to set all the available options. Alternatively, the options can be overridden by passing a parameter to the recent_comments template tag.
Usage and Options
The configuration page will help you to set up the plugin to your satisfaction.
If you also install the latest version of Plugin Output Cache the output of this plugin will be automatically cached for efficiency.
Finally…
I look forward to your help in ironing out any issues and implementing any good ideas. The plugin settings page has an option to submit bug reports but general comments can be left below.
Frequently Asked Questions
-
Is there a way to get output like ‘{commentauthor : snippetcharacterlink}’ but with the whole thing as a link?
You can build the output template any way you like using the tags as basic blocks with html and ordinary text as ‘glue’. In this case you could try:
<li><a href="{commenturl}">{commenter}: {commentsnippet:30} ...</a></li> <p>.
It’s a very flexible system and you can even extend it by creating new output tags. -
I wonder is it possible to display recent comments horizontally instead of the standard column fashion?
This applies to the output from the other post plugins too: the output is just a list and you can use CSS to style your list items to either display:inline or float:left. CSS gives you many possibilities.
-
How do I get it so that {link} displays the date instead of the title? If i use the {date} template tag, it shows the date but no link.
You need to use the output template to tell the plugin exactly what to display. For example, if you want a link where the visible text shows the date of posting you could try:
<li><a href="{url}">{date}</a></li> -
How do I format the output of the {date} tag?
The blog’s date format is used by default but you can change it by adding a format string. The Codex has a page on format strings. Let’s say you want the date to look like Sunday, January 14, 2007. The correct format string is ‘l, F j, Y’ so you would write
{date:l, F j, Y} -
I don’t want my post plugin widget to show on the main page, just the single post page. Is that possible?
Yes. The widgets now let you choose the condition under which they are visible. The condition can be set using any combination of WordPress Conditional Tags, e.g., ‘is_home()’, ‘is_category()’, or ‘is_page()’.
In this case the right condition is ‘is_single()’.
-
I’m trying to place the plugin output just after a single post but other plugins seem to get in there first. Any ideas?
Some plugins automatically tack on their output to the end of a post’s content. The only way to get something in between is to hope that those plugins offer a way to turn off that kind of behaviour and let you explicitly place their output with a template tag. The good news is that most plugins are cooperative.
-
I found a script that allows me to put thumbnail images [or anything else] with each post. I was wondering if there was a way to integrate that with this plugin?
If the script stores the thumbnails in a custom field you can use the output template tag {custom} to display them. Try
something like:<img src="{custom:thumbnail}" alt="{custom:thumbnail-alt}" />A similar thing can be done with many other plugins.
-
I want to show the same plugin in two different places but with different output: can I?
Yes. Decide on one of the output templates and other settings you need and set them up from the options pages. The other invocation of the plugin then gets called with passed parameters to get the different output.
e.g.,random_posts('limit=3&output_template={custom:another_field}') -
I want an output template tag to do xxxxxx. How do I invent one?
You have two choices: a) modify the output_tags.php in the post-plugin-library; b) use the {php} tag.
If you go down route (a) (which is actually very easy) please let me know the new tag and I’ll maybe include it in the next version. If you use the {php} tag do be careful not to start WWIII. -
I uninstalled one of your plugins and now my whole sidebar has disappeared. How do I get it back?
You have probably forgotten to remove the code calling the plugin, e.g., recent_posts();.
I find a good practice is to use something like:if (function_exists('recent_posts')) { recent_posts(); }That way, if I ever deactivate a plugin temporarily the website doesn’t fall apart.
49 Comments Add your own
1. Rob | March 17th, 2008 at 6:19 pm
2. Komik Videolar | March 21st, 2008 at 5:32 am
Great plug-in….
3. Partz Partzescu | April 4th, 2008 at 12:31 pm
Hello,
Can you add a function to load Mybloglog avatars when no Gravatar is available? There is a plugin for this but it doesn’t work with recent comments. The plugins Name is MyAvatar.
4. marka,logo tasarımı | April 8th, 2008 at 12:35 pm
nuxmedya marklaşmaya yönelik kurumsal kimlik tasarımı ile ilgili
profesyonel çalışmalar yapmaktadır
5. Yuda | April 8th, 2008 at 2:59 pm
Hi
Thanks for your great plugins!
I’m using Recent Comments, and on my dev machine (Apache) it runs fine.
However, when uploaded to my host (IIS, as per client’s request), I get a CGI error when trying to access any tab except the General Config tab on the admin section.
And the plugin doesn’t work at all :-(
CGI errors when running WP on IIS are a known issue for years, and there’s a fix that sometimes work using a special wp-db.php file - see recent post here:
http://wordpress.org/support/topic/131976
But usually the problem is on the front-end, and this time it’s only on the back, and only on the Recent Comments plugin tabs.
Maybe there’s something that can be done through the plugin code, something along the lines of the wp-db.php fix.
BTW, the WP version where the trouble arose is 2.3.1, for which the fix should work, but on the Recent Comments case it doesn’t.
I appreciate your help very much!
Yuda
6. Rob | April 8th, 2008 at 9:07 pm
7. Rob | April 8th, 2008 at 9:10 pm
8. Yuda | April 8th, 2008 at 10:50 pm
Hi Rob, thanks for your reply.
The modified wp-db.php can be found here:
http://wordpress.pastebin.ca/924003?srch=cgi+error
I used it once on another WP Windows installation, where I also had CGI errors, and it evaporated them - so as your plugins are using the DB, maybe what was done in wp-db.php can be applied to other files as well.
I’m aware wp-db.php should (and does) solve DB-related CGI errors across the board, but still… Just a hope.
I will test the other plugins. The client didn’t ask for them, so they can thank you for the nice bonus :-)
Thanks again
Yuda
9. Yuda | April 8th, 2008 at 11:25 pm
Caught it!
I have no idea why, but the URL of any options page, except for General Settings, in both plugins, and only on IIS, includes a redundant section, eg:
wp-admin/options-general.php/wp-admin/options-general.php?page=recent-posts&subpage=output
Anything I did wrong?
Thanks again
Yuda
10. Rob | April 8th, 2008 at 11:32 pm
Thanks for all the effort!
11. Rob | April 8th, 2008 at 11:36 pm
12. Yuda | April 8th, 2008 at 11:51 pm
OK, some more data: after stripping the redundant section, the options pages worked nicely, so did their saving.
But whenever I tried to move to another options page (and only among them) - I got the double URL section.
BTW, this also happened on the General Settings page, it just so happens that on the first call to the Recent Comments/Posts pages, it’s the General Settings tab that comes first - and correct.
But at least now I have a beautiful Recent Comments plugin working on the site! (it’s still under heavy dev, so no URL just yet).
Re the dump file - sorry, no can do, the host (oddly enough called easyCGI - go figure) does not provide access to it.
I do have access to IIS log files - will they help?
Have a good sleep!
Yuda
13. Rob | April 9th, 2008 at 7:53 am
It sounds like this should be fixable! (the plugin, not the weather). BTW what I was asking for wasn’t a dump file but just for you to use var_dump($_SERVER) or print_r($_SERVER) on the pages in question so that I can get to see what the values of those globals are. Obviously they are setup differently to ‘usual’ and knowing what they are could really help. Do you see what I mean?
14. John Kolbert | April 13th, 2008 at 2:58 am
I just upgraded the plugin (I’ve been using it for a while) and where my recent comments used to be it now says: “post-plugin library missing”. What does that mean and how do I fix it?
15. John Kolbert | April 13th, 2008 at 3:00 am
Ah, never mind about my comment above. I upgraded using the auto-upgrade feautre on WordPress. I should know to check the plugins website first. Sorry!
16. Rob | April 13th, 2008 at 7:49 am
17. Chris | April 14th, 2008 at 9:06 pm
Rob, I downloaded the most recent version of this plugin and uploaded it to my plugins dir and it wouldn’t show up in the list of available plugins in order for me to activate it.
Do you know anything about this?
I’m running a standard install of WP 2.5.
Thanks,
C
18. Rob | April 14th, 2008 at 10:20 pm
If all else fails, delete the folder you uploaded and try again.
19. Rob | April 15th, 2008 at 10:11 am
20. tbronson | April 16th, 2008 at 4:09 pm
Dunno if this belongs here, nor if it’s a known problem in general, but:
After upgrading to RC 2.5b19 using WP 2.5’s automatic plugin updating, my comments page displayed a no results found message. I fiddled around with it, resaved all the settings, but nothing. So I downloaded a copy and ftp-ed to overwrite the installed version, and everything was fine.
I guess it was a problem with WP auto updating, a file wasn’t copied or something?
21. Rob | April 16th, 2008 at 4:35 pm
22. C.Harv | May 1st, 2008 at 6:08 pm
Looked at configuration page, but can’t figure out how to change “commented on” in Recent Comments to “on.”
Where do I make this edit?
Thank you.
23. Rob | May 2nd, 2008 at 10:57 am
{commentlink: on }Let me know if it works for you or not.
24. Jarred | May 2nd, 2008 at 6:14 pm
Hi Rob. For some reason my category filter is not working. I have it set to exclude a category of posts from showing up, but they still do? If possible, shoot me an email instead of responding here and I can provide more detail?
Jarred
25. Jarred | May 2nd, 2008 at 6:18 pm
Scratch that, I’m not even using your plug-in for this, haha! Love Similar Posts and Recent Posts, though. :)
26. david | May 8th, 2008 at 7:12 am
Any chance you can provide some insight for me? I want comments from a specific category page to be posted on the main page in the main body. I have a middle column where I want this to pull, but I can’t seem to get it to pull. Thanks!
27. ClappingTrees | May 12th, 2008 at 11:15 am
Hi! For some reason, my Recent Comments are not showing up at all. Can help me please?
Josephine
28. ClappingTrees | May 12th, 2008 at 11:20 am
Hey! It’s okay now. :-p
29. Rob | May 12th, 2008 at 1:47 pm
30. Jarred | May 15th, 2008 at 3:33 pm
Hi Rob,
NOW I am using your recent comments plugin (haha) and think it’s great.
A suggestion: I use the group by post function. Is there a way in the next update to have it so that the post with the most recent comment (and all recent comments within the restrictions of the output number) show up on top. Right now, the most recent post with a recent comment within the output restriction shows up first… but that means that the newest comments may not get noticed because they appear midway in the list of posts.
Does that make sense?
Jarred
31. Rob | May 16th, 2008 at 3:48 pm
32. Nick Mouratidis | May 17th, 2008 at 2:21 am
Thanks for the wonderful plugin!
One question though….
Is there a way so Recent Comments displays the i.e. the 5 more recent comments but only one comment per post?
I have the plugin on my blog showing my 5 most recent comments but I hate it that all of them are from the same post. I want only the latest comment from each most recently commented post.
I hope you got what I mean. My english are not so good.
Is there a way to do that?
Thanks.
33. Rob | May 17th, 2008 at 3:12 pm
and change it to:
Good luck!
34. MhawSayar | May 18th, 2008 at 8:23 am
Thank you so much for great plugin!
35. Sansnom | May 19th, 2008 at 12:11 pm
Hi,
The plugin works like a charm but links generated go to comments.php. How to make links go to comments_popup.php ? How to make links of recent comments open the comments popup ? Thanks in advance for light,
S
36. Rob | May 19th, 2008 at 3:27 pm
37. Rob | May 19th, 2008 at 4:48 pm
38. Sansnom | May 19th, 2008 at 5:48 pm
Hi,
1000 thanks for your help. I have tried to upgrade the Post-plugin library but impossible to desactivate the plugin ! I click but it doesn’t desactivate the plugin. So I have upload the new version 2.5.0.2 (called strangly 2.5.0.3 on the dedicate plugin page / I have download the 2503 but when upload admin panel tells it’s the 2502). After the upload done, the plugin is already activate (Because of my problem of desactivation) but in the options of Recent comments plugin there is not the {commentpopupurl}… I’m sorry to have these bad news… :-x :-)
39. Sansnom | May 19th, 2008 at 5:58 pm
News : I have succeed to upgrade to the 2503 because the admin page tells me it exists an upgrade and automatic upgrade have worked… but the tag doesn’t appear in my recent comments plugin… Still looking :)
40. Rob | May 19th, 2008 at 6:03 pm
41. Sansnom | May 19th, 2008 at 6:20 pm
ok :-)) ! Thanks for everything. It’s perfect now for me !!!
42. Sansnom | May 19th, 2008 at 6:32 pm
Me again… :x Sorry !
Now the link open the right popup but… not in front of the right comment. With commenturl you are sent to the right comment under the right post, with commentpopupurl you are sent only to the right post. When there is lot of comments, it’s difficult… I tell this but perhaps I haven’t done the right thing…
S
43. Rob | May 19th, 2008 at 10:15 pm
44. Sansnom | May 19th, 2008 at 11:40 pm
In fact, it’s a matter of comment-ID. When I use your commenturl, the url made is like that : http://www.mysite.com/2003/11/03/a-topie-1/#comment-11130, when I use your commentpopupurl, it’s like that : http://www.mysite.com/?comments_popup=123 where 123 is the post-ID. In WP, it’s the natural behaviour of the popupup because when you call it usually, you never call a comment in particular. But here, we need to target a specific comment but to make it appear in a popup… and I don’t know how because I can’t find on internet an example of link with these 2 parameters…. F^%£ :(
45. Sansnom | May 19th, 2008 at 11:45 pm
Perhaps It would be better to use comment_popup_script (http://codex.wordpress.org/Template_Tags/comments_popup_script) with the classic url (http://www.mysite.com/2003/11/03/a-topie-1/#comment-11130 where 11130 is the comment-ID), but I don’t know how to code this. I stay searching.
46. Sansnom | May 20th, 2008 at 12:48 am
This kind of link works : “http://www.mysite.com/?comments_popup=1334#comment-10928″ if we put in the comments_popup.php template just after
foreach ($comments as $comment)this :<a name="comment-<?php comment_ID() ?>" id="comment-<?php comment_ID() ?>"></a>,. The last problem is the automatic generation of this link. :)47. Rob | May 20th, 2008 at 10:14 am
48. Rob | May 20th, 2008 at 11:39 am
Thanks for the investigative work.
49. Sansnom | May 20th, 2008 at 1:55 pm
It works like Terminator now ! ;-) Thankx again for your plugin.
Leave a Comment
Trackback this post | Subscribe to the comments via RSS Feed