Boycott Israel

Keyvan Minoukadeh

WordPress Paged Comments Plugin

Filed under: General — Keyvan @ 12:24 am

Paged Comments is a plugin for WordPress to allow comment paging. Useful for those popular blog entries receiving many comments, or a simple guestbook page within WordPress.

Features

  • Comment ordering: show latest comments first, or last
  • Specify number of comments to display per page
  • Enable paging for all posts and pages, or on a per-post basis
  • Give users the choice to view all comments on one page with a ’show all’ link
  • Specify the first or last page of comments to load by default
  • See paged-comments-config-sample.php for more

Download — Latest Version

Related Downloads

Installation (for Wordpress 2.3+)

If you’re upgrading from a previous version, skip these installation steps and read the upgrade steps. Note: WordPress’ automatic upgrade feature will erase the plugin’s config file. If you’re going to use it, make sure you backup your paged-comments-config.php file first.

  1. Download and extract plugin files to a folder locally.
  2. Read through and edit paged-comments-config-sample.php to configure, then save the file as paged-comments-config.php.
  3. Upload the whole paged-comments directory to /wp-content/plugins/. The plugin files should now be in /wp-content/plugins/paged-comments/.
  4. Enable the plugin through the WordPress admin interface. That’s it!

Optional Steps

  • WP 2.7 users: If use_wp_config is set to true (default), you can make changes to the plugin config using the WP admin interface. Go to Settings > Discussion and look under ‘Other comment settings’.
  • To customise the template to work better with your theme: Open the plugin’s themes folder and find the subfolder corresponding to the WordPress theme you’d like paged comments enabled on (or if your theme isn’t listed, choose the ‘default’ folder). Upload comments-paged.php to the appropriate WordPress theme folder (found in [wordpress]/wp-content/themes/).

    For example, if you’re using the default WordPress theme, copy [paged-comments-plugin]/themes/default/comments-paged.php to [wordpress]/wp-content/themes/default/. (The plugin always tries to load comments-paged.php from your active theme folder first.)

    Make any modifications to comments-paged.php. The file is based on the comments.php file, so if your theme is very different it might be easier to copy in the necessary elements from paged-comments.php. View the diff report to see what you need to change.

Examples of Use

The comments on this page are handled by the plugin, but it’s also used by the following sites:

Questions?

Donate

I work on this plugin in my spare time. If you find it useful, please consider donating to help me continue work on the plugin. (This plugin is, and will remain, free software, please only donate if you want to.)

This month I’ve received £0 ($0/€0) :(

Paid Support

If you run a commercial site and you’re having difficulty setting up paged comments, I now offer paid support. Feel free to get in touch: keyvan (at) k1m.com

808 Responses to “WordPress Paged Comments Plugin”

Pages: « 8113 12 11 10 9 [8] 7 6 5 4 31 » Show All

  • 80
    Aleister

    Very nice plugin. Just what I was looking for. Works great! :)

  • 79
    Technical Assistance Request! - Pop Occulture

    [...] Overall, it’s probably not the world’s hardest plugin to build, especially since you might be able to re-purpose some of the code from Keyvan’s paged comments plugin (which is sort of similar, but not quite). If there’s anybody who’d like to help a brother out with this, let me know. I don’t really have any money to throw at you, thanks to my upcoming move. But maybe we could trade a little bit of freelance design, or some kind of other arrangement. Or you could do it just cause you like me so much and want to help a brother out. That works too! Either way, drop me an email. Thanks! Read Similar Articles: [...]

  • 78
    Keyvan

    Hi all, I will respond to the questions, but I still need a few more days.

  • 77
    » WP Plugins Galore @ Ambot ah! [ technology news and reviews ]

    [...] Paged Comments - very sueful if you have entries with hundreds or even thousands of comments. [...]

  • 76
    Tim Boucher

    This looks like an awesome plugin! Thanks for all the work you’ve done on it, Keyvan.

    I have a question about a possible modification though. If you point me to any possible resources to help me out, I’d appreciate it. What I’m looking for is very similar to what you’ve done here with a few small differences.

    (1) By default, all comments would be shown on a post page, and the paging would come into play as described below.

    (2) I’d like for the permalink for a comment to point to an individual comment page. The comment page would feature the title and excerpt from my original post, plus some text that says “This is a comment page, etc etc”. And then there would be buttons that say “view all comments,” “leave a comment,” and “Previous” and “Next.”

    Does this sound like something I could easily build based on your existing plugin code, or would it require a lot of changes? I don’t have a ton of raw PHP programming experience, so any pointers and resources you could throw my way would be very much appreciated. An email or response here would be great!

  • 75
    Dayna

    Hi, I’m here again, I’ve got a minor question.

    The comments number is a bit odd now.

    http://liberta.espoireve.com/essence/guest-book/comment-page-2/

    The comments number starts with 1 for the latest comment, if you click on page 1, the first comment is still 1.

    I’m using this code by CodeForged to generate the comments number, is there a way to fix it.

    Thank you.

  • 74
    Keyvan

    Thanks for reporting back Dayna! Good to know it’s working for you. Hope it does for others as well. :)

  • 73
    Dayna

    Hi Keyvan,

    I’ve tested out the fix you’ve given on my WordPress 2.0 and there’s no problem with it, working great. Thank you :)

  • 72
    Keyvan

    WordPress 2 URL fix:

    Open paged-comments.php and find the ‘=== END EDITING ===’ lines. After the two lines paste the code below. In WP2 the rules for determining the requested page/post have been moved out of the .htaccess file and into PHP code. I couldn’t figure out the best way to hook into the rewrite process, so I’ve opted for a simpler approach: before WP’s parse_request kicks in, we look for the URL segment identifying the comment page, note the comment page number and strip it out of the REQUEST_URI so WP doesn’t kick up a fuss when it comes to parse the request itself. I’ve not tested this extensively, so please treat with care and report any problems. Thanks. (Still a bit rushed so not had a chance to release a new version or update the instructions.)

    Note: If you’re setting this up on WP2, please disregard step 7 as it’s no longer required. (In fact, the new rewrite rule in WP2 matches pretty much any URL structure so the additional rules in step 7 won’t even be evaluated if you do include them.)

    if ($paged_comments->fancy_url) {
        add_action('init', 'paged_comments_fancy_url');
    }
    function paged_comments_fancy_url()
    {
        $req = rtrim($_SERVER['REQUEST_URI'], '/');
        if (preg_match('!^(.+/)comment-page-([0-9]+)$!', $req, $match)) {
            $_GET['cp'] = $match[2];
            $req = $match[1];
        } elseif (preg_match('!^(.+/)all-comments$!', $req, $match)) {
            $_GET['cp'] = 'all';
            $req = $match[1];
        }
        $_SERVER['REQUEST_URI'] = $req;
    }

    You can view the changes in the project’s trunk at the WP Plugin Repository.

  • 71
    Dayna

    This is a very useful plugin. :)

    Is there any way to fix the issue about the rewrite rules? I’m using WordPress 2.0

    Thank you.

Pages: « 8113 12 11 10 9 [8] 7 6 5 4 31 » Show All

Leave a Reply