Recent Comments Plugin

October 17, 2006


I’ve always like “RecentComments” features, and so I went looking for one. There are a couple of different ones floating around, but this one seemed simple, and simple is usually just about right. I installed it then modified the sidebar with this code:

<li><h2>Recent Comments</h2>
<ul><?php mdv_recent_comments(6, 30, ‘<li>’, ‘</li>’, true, 0); ?></ul></li>

The parameters for the function are:

$no_comments – sets the number of recent comments to display
$comment_lenth – the number of characters to display as a comment excerpt
$before – text to be displayed before the link to the recent comment
$after – text to be displayed after the link to the recent comment
$show_pass_post – whether or not to display comments from password protected posts
$comment_style – sets the style of comment to be used

  • 1 = “CommenterName on PostTitle” with CommenterName being a link to the comment
  • 0 = “CommenterName: WordsOfComment” with WordsOfComment being a link to the comment

I made some changes to the plugin…

  • Changed from showing a certain number of words per comment to a certain number of letters.
  • Removed any trailing spaces and added “…” to the end of the comment text.
  • Formatted the title of the link a little differently

About Lloyd

Lloyd Sommerer is a middle/high school teacher who likes to build websites, read books, grow beards, make fun of Lauren’s prototypes and eat the sauce of the picante.

View all posts by Lloyd

One Response to “Recent Comments Plugin”

  1. Lloyd Said on:

    This is out of date now. look in plugins and at the sidebar to see what’s going on now.


Leave a Reply