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.

  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

  • 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

744 Responses to “WordPress Paged Comments Plugin”

Pages: « 7517 16 15 14 13 [12] 11 10 9 8 71 » Show All

  • 120
    Mike Evangelist

    Keyvan - thanks for a very useful plug-in! It’s exactly what I needed to speed up loading on my popular pages.

    Mike

  • 119
    Binary Blue nearing Version 1.0 | 4null4.de - Blog around the world

    [...] The basic idea has been borrowed (along with a few lines of code) from Keyvan’s Paged Comments Plugin, but the configurability through the theme’s options page and especially the complete AJAX functionality has been handcoded from scratch. Especially the inability of prototype.js to handle responseXML has cost me several years of my future live, I fear [...]

  • 118
    Keyvan

    New bug-fix release is now available for download. Fixes the trailing slash issue and the comment numbering issue when DESC and fill_last_page are both enabled. Thanks to Jonathan and Tanster. No new features introduced in this release, but I recommend you upgrade. (Which just involves replacing paged-comments.php if you’ve already got your paged-comments-config file in place.)

  • 117
    Jonathan

    Not at all, Keyvan, you’ve already implemented the “Comment awaiting moderation” feature I suggested a while ago; and from your code, I now understand how Wordpress 2 handles permalinks! I actually tracked down the looping redirects quite quickly (which is unusual for me!) after I noticed the 301s in the access log! For normal Wordpress pages it shouldn’t matter as they don’t care about the “/”. I just want all my pages indexed with it there for consistency!

  • 116
    Keyvan

    Thanks Jonathan. I should be more careful tampering with these things. I’ll try and put out a new release tonight with this change. Hope it didn’t waste too much of your time pinning the problem down (I know these infinite loops can be a bit of nightmare to resolve). Thanks for letting me know.

  • 115
    Jonathan

    Thanks for updating the plugin to support Wordpress 2 fully.

    I have one slight issue with the fancy URL feature which caused issues with a non-wordpress part of my site (and which I can see interfering with other plugins).

    The first line of your code strips off the trailing “/” if there is one. This is then written back to the variable $_SERVER['REQUEST_URI'] even if the page in question is not a comments page, or indeed even if it’s not a Wordpress page.

    I’ve changed your code so that $_SERVER['REQUEST_URI'] = $req; is inside each of the “if” statements, so that the URI is untouched if it doesn’t refer to a comments page.

    (Part of my site checked for a trailing “/” and added it if it wasn’t there. So I had an infinite loop! I know there’s a plugin that does this for Wordpress pages too!)

  • 114
    Dayna

    Yup, it was the one with the

    /comment-page-1/#comment-687

    Right, I like that idea I think it would be rather convienient as well. :)

  • 113
    tanster

    Thanks Keyvan! I’m really happy with how it turned out.

    :) tanster

  • 112
    Keyvan

    Tanster: Nice site! Glad the plugin’s finally working okay. :)

    Dayna: Glad it’s working. Just curious, was it the URL function I mentioned, or something else?

    Regarding the template file and paging. I’m still going to add your suggestion of an option to restrict paging to posts or pages. The idea behind using a single comments template is to make maintenance of the template file easier. The way the plugin works at the moment means users have to maintain two comment templates (comments.php and comments-paged.php). So to get a consistent theme you end up having to duplicate any template changes you make in one template to the other.

    When I say the plugin will always use comments-paged.php in a future version, I don’t mean it’ll force paging. Just that while the plugin is active you’ll only have to worry about the one template—so, as before, you’ll still see all comments on a single page if paging isn’t enabled. I hope that makes sense. I think I’ve confused myself talking about it! (And having a template called comments-paged.php will probably cause even more confusion when this change comes into effect!) :) I’m open to suggestions though. If you think this is bad idea, or if you can think of something better, let me know.

  • 111
    Dayna

    Keyvan: Thanks, it’s working now. :) Good luck in the new version. And a question regarding the new version, you mentioned to use the comments-paged.php whenever the plugin is activated. So what if I only want paged comments for my pages and not posts?

Pages: « 7517 16 15 14 13 [12] 11 10 9 8 71 » Show All

Leave a Reply