WordPress Recent Comments Plugin / Widget

This plugin will add a list of the most recent comments posted to your blog. They are gathered in descending order (newest at the top), but then grouped by post title, so that comments from the same post are listed together. The list items will be links to the comments, and will contain the name of the commenter.

The following parameters are configurable by the user, either from the widget admin interface or directly (if used as a standalone plugin):

  • Number of comments to show: Total number of comments to display
  • Number of words per comment excerpt: The first N words of the comment will be listed
  • Max comments per post: This option is a “cap” to ensure that multiple posts are included in the list, even if all the recent comments were from a single post.
  • Max letters per word: This option is to deal with long “words” in the comments (specifically raw URLs) that can interfere with the formating of the list, depending on the CSS rules applied.

Download FreePress Recent Comments Widget

Installation:

  1. Extract all files in the archive into your plugins directory. The archive should contain a folder called “freepress”, which should be placed directly under the plugins directory, and all the files distributed with this plugin should be in the “freepress” folder. For example: /var/www/wordpress/wp-content/plugins/freepress/recentCommentsWidget.php
  2. If you are using the widgets plugin, the tagboard will automatically appear as an available widget for your sidebar.
  3. If you prefer to manually add the tagboard to your theme, you can insert the following code wherever you’d like the tagboard to show up:

    <?php
    if(function_exists('fp_get_recent_comments')) {
    echo fp_get_recent_comments(7, 5, 5, 0);
    }
    ?>

    The arguments are in the order described in the list above. In this example, it would show 7 comments total, 5 words from each comment as an excerpt, a maximum of 5 comments from any one post, and no limit on the number of characters per word in the excerpts.

*Note: This version of the plugin has been tested in WordPress 2.x as well as recent versions of WordPress MU. Please let me know by commenting here if you run into any issues.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.