WordPress Paged Comments Plugin

This plugin is no longer being developed. WordPress has had paged comments support in the core since version 2.7. The comment paging you see here is using WordPress’s built-in code and not my plugin.

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

Installation (for WordPress 2.3 up to 2.7)

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?

Paid Support

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

540 Comments

  1. Posted 20 February 2008 at 1:58 am | Permalink

    thanks very nice..

  2. Achim Mentzel
    Posted 20 February 2008 at 10:02 pm | Permalink

    I had to uncomment the line

    $file_contents = str_replace(‘

  3. Posted 20 February 2008 at 10:57 pm | Permalink

    Love how you’ve simplified the install process. I have multiple blogs and spend too much time doing installs at the moment. Thanks.

  4. Posted 21 February 2008 at 7:20 pm | Permalink

    It’s very good article. Great site with very good look and perfect information.

  5. Posted 21 February 2008 at 9:15 pm | Permalink

    Hi there,

    Is it possible to create pages of all comments no matter which post it is associated with? Ie. An “All Comments Archive” page?

    Thanks
    Sandra

  6. Chris Jennings
    Posted 21 February 2008 at 10:06 pm | Permalink

    I’m using is_single = true; ?> to make the homepage show the latest post in the single post format (like found here http://www.clarkandmichael.com/) However, i feel that your plugin is still evaluating that it still “is_home” and not showing the right comments version. Single.php works perfect.

    Do you know a way that you can serve my homepage the same way as you serve the single.php view?

  7. Posted 22 February 2008 at 11:58 am | Permalink

    Thanks for an awesome plugin Keyvan. I had to use I received too many comments on my own plugin’s page:

    http://ryanhellyer.net/2008/01/14/suckerfish-wordpress-plugin/

  8. Fabien
    Posted 22 February 2008 at 2:42 pm | Permalink

    Working when commenting the line :
    $file_contents = str_replace(‘<‘.’?php’,'<‘.’?’,$file_contents);

    (Windows Server – WP 2.3.3)

  9. Posted 28 February 2008 at 3:47 pm | Permalink

    Where is the ‘user manuel’ or ‘user guide’? I have install the plugin, but how do I enable it to work only at a specific site like homepage.com/guestbook ?

    Best regard
    RaA

  10. Posted 29 February 2008 at 12:15 am | Permalink

    thanks good plugin. is it compatible with wp 2.3 ?

  11. u13
    Posted 14 March 2008 at 2:00 pm | Permalink

    threaded comments just like here – how? )

  12. Posted 18 March 2008 at 10:44 pm | Permalink

    Nice plugin, and I’m gonna use it. Seems to be the best one out there…
    Thanks!

  13. g t
    Posted 28 March 2008 at 1:39 pm | Permalink

    anyone has tested this plugin with the upcoming wordpress 2.5? TIA

  14. g t
    Posted 31 March 2008 at 4:41 pm | Permalink

    Works fine on wordpress 2.5

  15. Posted 1 April 2008 at 1:51 am | Permalink

    Thanks for your plugin, it works great!

  16. Posted 1 April 2008 at 4:43 am | Permalink

    Hi Keyvan!

    Just wanted to say THANKS so much for your plugin, it works great! I had over 800 comments on my blog today and needed to do something fast — and your plugin was it!

    I had to make one minor change to get comments that are awaiting moderation to show up in WPMU in wp-content/plugins/paged-comments/paged-comments.php —

    diff paged-comments.php.orig paged-comments.php
    172c172,174
    if ( $user_ID ) {
    > $approved_condition = “(comment_approved = ‘1’ OR ( user_id = ‘$user_ID’ AND comment_approved = ‘0’ ))”;
    > } else if (empty($comment_author)) {
    742c744

    Thanks again,
    Lisa

  17. Don
    Posted 1 April 2008 at 10:34 am | Permalink

    Hi, I tried to use this plugin on a WordPress Mu instalation. and it’s not working… are there any ways to fix this ?

  18. Posted 2 April 2008 at 12:23 am | Permalink

    Installed on 2.5 but fancy_url does not work. All links end up on default page.

  19. Posted 13 April 2008 at 4:52 pm | Permalink

    i installed this plugin but i want to display the comment’s order number on the top-right, similar to yours. plz help me to do that.

  20. Gene
    Posted 16 April 2008 at 1:56 am | Permalink

    Hi Keyvan,

    Nice concept but would need a little “fine tuning”. I have a 3-column theme and even though I transfered comment-paged.php (default and tried all of the others), the layout isn’t good, the text is way too close to my sidebars.

    Wouldn’t it be a good idea to implement a CSS to this template so the user may adjust margins, padding, etc.?

    Thanks,
    Gene

  21. Gene
    Posted 16 April 2008 at 4:15 am | Permalink

    OK, disregard my other comment, I modified my existing comment.php to include the code in the SVN and my layout is now fantastic.

    Tell me something though, is: <a href=”” title=””> necessary? All it does is turn my boxed comment header into a link…

    Thanks,
    Gene

  22. Posted 19 April 2008 at 7:42 pm | Permalink

    Hi Keyvan,, I’m trying out the plugin right now on my web site. It works fine but I’ve ran into a problem. I’ve searched here and on the web for a solution but I have not found one.

    My problem is with linking to comments. I have links in some posts which are in the form <a href=”#comment-1234″ rel=”nofollow”>. Now they no longer work because the URL for the page the user is currently watching gets prepended. So if the comment is really on page 10 but the user is watching page 11, then the href above turns into a URL of the form …/comments-page-11/#comment-1234

    What is the solution? Am I to use a special syntax to link to comments? Have I hit onto a real problem?

    Thanks,
    Louis

  23. Posted 29 April 2008 at 9:15 pm | Permalink

    “Vladimir
    April 2nd, 2008 at 12:23 am

    Installed on 2.5 but fancy_url does not work. All links end up on default page.”

    >>> I have This probleam…

  24. Posted 30 April 2008 at 6:49 pm | Permalink

    Hi – I have been using this for a while and it is great. I have just upgraded to WP 2.5 and have spotted a small problem. On a test blog using the WP Default theme, activating the paged-comments plugin disables the new built in support for Gravatars.

    I have just realised while writing this that the reason is that the theme specific entry in the themes directory is out of date wrt WP 2.5 so at least I now know how to fix it :) Looking at it, there are quite a number of details in there that need bringing up to date with the current version of the theme.

  25. Posted 1 May 2008 at 7:21 pm | Permalink

    Thanks for your plugin!

    I recognized a problem: Paged Comments (Version 2.6.4) does not work, if WordPress is installed in a subdirectory (example.com/wordpress) and called from homedirectory (example.com). The links to the individual pages are wrong then.

    How can i fix this Problem, without changing the directory?

  26. Posted 8 May 2008 at 8:20 pm | Permalink

    Hello Keyvan,

    if you look at the guestbook of my page you will see that the comments are ordered with the latest being on top, but unfortunately the numbering starts all over again on each new page. How can I modify the files so that the latest comment in the guestbook will have number 20, for example, instead of number 1? Have been trying to figure this out for quite some time now, but I didn’t know how to do it. I already copied the default comments-paged.php to my theme’s folder (I’m using a modified “beachtheme”) but still the numbering starts all over again on each page…Do you have any ideas/instructions? Would be greatly appreciated :-)

    Regards

    Robert

  27. Posted 8 May 2008 at 9:23 pm | Permalink

    Oh, my bad, didn’t paste the website URL into the comment text :-) so, here it is for you to check out what’s actually going on there: http://www.FSR-ARCTeam.de

    Thanks!

  28. Posted 2 July 2008 at 4:14 pm | Permalink

    Hi —

    I made a comments-paged.php that works with the Sandbox theme. Thanks for the plugin. :)

    http://striderweb.com/nerdaphernalia/2008/07/paged-comments-for-wordpress-sandbox-theme/

  29. Posted 13 July 2008 at 3:30 am | Permalink

    Thank you all for commenting, I’ve been so busy that I haven’t had time to respond. I’ve just released a new version with the following changes:

    • Posting a new comment will now redirect you to the comment page holding the new comment
    • The default paged comment template (comments-paged.php) has been updated to reflect the comments template used in WordPress 2.5.1 (comments.php)
    • Templates added for the Sandbox theme (thanks Stephen) and i3Theme (thanks Mickey)
    • New language files for Italian (thanks Geremia) and Spanish (thanks Alejandro)
    • Updated licence to GPLv3
    • Added a fix for WPMU (thanks Lisa)

    Let me know if you come across any problems. If you’d already posted about a problem that I haven’t addressed in this release, please remind me again. I hope to have another release out soon.

  30. Posted 13 July 2008 at 6:43 am | Permalink

    I’ve come across a bug.

    Let’s say I have 5 pages of comments on a post. On the “top” page, each comment has a permalink. When enough comments are added that comments page 6 is added, the comments on page 5 now have a _different_ permalink.

    This is broken. Permalinks must not change, ever. By definition. So, comments on the top page must have the /comment-page-x/ added to the URL.

    (The comment-page-x URL _works_ even for comments on the top page, it’s just not the link presented.
    …unless I did something wrong in the Sandbox comments-paged/php ?

  31. Posted 13 July 2008 at 12:18 pm | Permalink

    Stephen: I think you missed out a call to paged_comments_url() in the Sandbox template. I’ve added it to trunk, you can view the difference. Let me know if that solves it.

  32. Posted 14 July 2008 at 3:21 am | Permalink

    2.7.1 fixes the issue where incorrect permalinks were displayed on the ‘show all’ page.

  33. Posted 15 July 2008 at 2:21 pm | Permalink

    I don’t know much about PHP but I’ve installed your plugin and all is working great with it. The only thing I want to do is remove the numbers that are displayed below the avatars as this was only added after adding your plugin.

  34. Tom Riddle
    Posted 17 July 2008 at 8:20 am | Permalink

    I set “fancy_url = false” and get 404 error when submitting comments.

    I think the bug is in function “paged_comments_post_redirect_location”

  35. Posted 17 July 2008 at 8:34 am | Permalink

    I have fix it Keyvan. Just replace “&” -> “?” .

  36. Posted 18 July 2008 at 1:43 pm | Permalink

    I want to display the search field like your comments section. Which plugin have you used for ?

  37. Jamie
    Posted 19 July 2008 at 6:33 pm | Permalink

    I downloaded the upgrade… and now I don’t see the plugin listed under my plugins? However, paged comments are there and appear to be working. Where did the file go? Hmmm

  38. Posted 25 July 2008 at 1:17 pm | Permalink

    Keyvan,

    I’m using Paged_Comments 2.7.1 with WordPress 2.3 and the theme Tiga-06

    I get this error with no comments loading:

    Call to undefined function: get_avatar() in

    [….]/blog/wp-content/plugins/paged-comments/themes/default/comments-paged.php on line 36

    I think that the problem may be that Tiga does not handle avatars. Is there a workaround for this as I do not want to change my theme.

    It’s a great plugin and I would very much like to use it. Many thanks for any help you can give.

  39. Posted 25 July 2008 at 2:56 pm | Permalink

    Joseph: To remove the numbers displayed below the avatar, you’ll have to edit comments-paged.php and remove this line:

    
    <div class="comment-number"><?php echo $comment_number; $comment_number += $comment_delta;?></div>

    You can also hide the numbers by editing your stylesheet.

    Tom: Can you send me the URL of a page where you’ve had to replace ‘&’ -> ‘?’. As for the comment search box. It’s a plugin someone else developed that, as far as I know, is not being maintained any more. I’ll see if I can find a link.

    Jamie: Which version of WordPress are you using?

    TonyN: The default paged comments template has been updated for WordPress 2.5. You can download the previous template and place it in your Tiga-06 theme folder (found in wp-content/themes/). That should resolve the problem.

  40. Posted 27 July 2008 at 10:41 am | Permalink

    Keyvan

    Re #698 and #699, Many thanks.

    I have tried putting comments-paged.php from Page Comments version 2.5 in the /blog/wp-content/themes/tiga-06, which I assume is what you were suggesting. This gets rid of the ‘Call to undefined function: get_avatar()’ error message and the comments etc are displayed, but without any formatting. They just display right across the window over the default background of the theme, not in the comment area.

    Any suggestions, or am I asking the impossible?

    I cannot find a download of Paged Comments version 2.6

  41. Dave
    Posted 30 July 2008 at 10:21 pm | Permalink

    Thanks for this, is there a way to make this work with Sexy Comments?

    Thanks again

  42. Posted 31 July 2008 at 7:16 pm | Permalink

    Is there a way to remove the gravatars?? I don’t want that and they’re slowing my page down.

  43. Posted 4 August 2008 at 8:45 am | Permalink

    Keyvan,

    Update on #701: I have now tried ver 2.6, but with the same results.

  44. Posted 4 August 2008 at 12:36 pm | Permalink

    TonyN: If the default comments-paged.php is not compatible with your theme, you’ll have to create a custom template file. This involves a bit more work. The easiest way is to save a copy of /wp-content/themes/tiga-06/comments.php as /wp-content/themes/tiga-06/comments-paged.php. Then edit this comments-paged.php file and copy in the paging code from the default comments-paged.php file. You can see an example of changes made to the default comments-paged.php file to enable paging. Yours won’t be exactly the same, but it shouldn’t differ too much.

    Dave: If that’s another plugin, I don’t have time right now to look into compatibility issues.

    A Cowboy’s Wife: You should be able to remove gravatars by editing comments-paged.php and removing the line that pulls in gravatars.

  45. Posted 7 August 2008 at 12:54 pm | Permalink

    Hi,

    I’m having trouble with the links to pages and comments.

    If fancy_urls is set to true, the page navigation doesn’t work. Currently I have 5 comments per page, and the links to the pages are in the format:

    /comments/comment-page-1/#comments

    However, the links all go to:

    /comments#comments

    If fancy_urls is turned off, the links to pages are in the format:

    ?page_id=107&cp=1#comments

    and they go to:

    /comments?cp=1#comments

    (/comments is a page I have created for feedback – like a guestbook)

    I’m using WordPress Version 2.6.

    Any ideas?

  46. Posted 8 August 2008 at 12:31 am | Permalink

    Hello Keyvan,

    Just a heads-up to thank you again for this great plugin.

    I can confirm that we have the Paged Comments 2.7.1 working just fine with WordPress 2.6 and the K2 theme (v1.0-RC7) over at http://www.timmclean.org <- a memorial tribute site.

    BTW, Dan, just below me…. do you have Permalinks set up and working correctly in your WordPress installation? We have fancy URLs working properly.

    Cheers,
    Rob

  47. Posted 10 August 2008 at 10:19 pm | Permalink

    Hi Rob, I do have permalinks set up and working. Just not the right settings!

    After experimenting with the WP permalinks settings, I found that a custom format was the problem. I don’t need it, so I’m using one of the presets.

    Using a preset instead of a custom setting doesn’t actually change the permalinks for pages, but fixes the problem nonetheless.

    So the plugin is working fine now.

  48. Posted 11 August 2008 at 1:49 am | Permalink

    Tim: Thanks. I’m glad it worked okay for you.

    Dan: I’m glad it’s now working, but I’d be interested to know what custom format you were using that caused the plugin to fail.

  49. PARIS
    Posted 11 August 2008 at 7:24 am | Permalink

    I recognized a problem: Paged Comments (Version 2.6.4) does not work, if WordPress is installed in a subdirectory (example.com/wordpress) and called from homedirectory (example.com). The links to the individual pages are wrong then.

    How can i fix this Problem, without changing the directory?

  50. Posted 11 August 2008 at 12:51 pm | Permalink

    Paris: I’ve tested the plugin using WP installed in a subdirectory, try here. I’m not sure what you mean by ‘and called from homedirectory’ though, are you accessing it in a different way?

281 Trackbacks