logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$50
Comments Pagination -Move comments to

Some of my posts have hundreds of comments. I have this "Break comments into pages with 50 top level comments per page and the last page displayed by default" selected.

Everything's good when there's under 50 comments but when the 51st comment comes, all comments before it are moved to "Older Comments" page so there's now only one comment showing.

I would like to change it so that when there's more than 50 comments, they are moved one-by-one to the "Older Comments" pages, so the post page would always show 50 latests comments.

I found a plugin ( http://winkpress.com/articles/fix-reversed-comments-pagination/ ) that does just this but with just one problem.

With this pluging you are only able to choose "Comments should be displayed with NEWER comments at the top of the page."

So if somebody is able to modify that plugin so that I can display newer comments at the end of the page, that would be great!

( If you can solve my problem without using that plugin, it's OK also. I just thought it would probably be easiest to solve this problem by just modifying that plugin. )

This question has been answered.

HarriL | 11/26/11 at 11:45am Edit

Previous versions of this question: 11/26/11 at 11:50am

(6) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    11/26/11
    11:51am
    Charles Klycinski says:

    Can You send me a PM or write here Your webiste address ? I will look into it.

  • avatar
    Last edited:
    11/26/11
    2:31pm
    Hardeep Singh says:

    Please share the site address and do you need threaded view too?

  • avatar
    Last edited:
    11/26/11
    6:10pm
    Manoj Raj says:

    Whats the wordpress version are you using? I really can't understand your problem. Anyway i assume that you want to display 50 comments at the landing page of an article. (And that should be ordered from older to newer comments). Right?

    Why don't you set the discussion settings this way?

    Break comments into pages with top level comments 50 per page and the first page displayed by default .
    Comments should be displayed with the older comments at the top of each page

    In this way the landing page always show oldest 50 comments. And the newer ones will be added in the subsequent pages..

    • 11/27/11 4:15am

      HarriL says:

      Yeah but I would like to show 50 newest comments. They are in my case usually more relevant than the older ones.

    • 11/27/11 4:19am

      HarriL says:

      Oh and the wordpress is: 3.2.1

      So basicly I would like to break comments into pages with 50 top level comments per page..
      And always show 50 latest comments on the landing page, Newest being at the end.

    • 11/27/11 5:52am

      Manoj Raj says:

      Hi Harril,

      Check the following url. I have numbered the comments

      http://comnedy.com/wpquest/2011/08/01/hello-world/

      Is this the way you want the comments to appear?

      The newest at the bottom. Right?

    • 11/27/11 6:01am

      HarriL says:

      Yeah I think that's what I'm looking for. How did you do it?

    • 11/27/11 6:03am

      Manoj Raj says:

      Here is the solution

      I have used the plugin you provided. In addition I have used jQuery order reverser plugin written by Corey H Maass.

      First thing - Edit comments.php

      search for <ol class="commentlist"> (as in twentyeleven theme)

      add an id so that it becomes <ol id="reverseorder" class="commentlist">

      include the jquery http://lab.arc90.com/tools/jquery_reverseorder/jquery.reverseorder.js in your header.php file

      and add

      <script type="text/javascript">
      $(document).ready(function () {
      $('ol#reverseorder li').reverseOrder();
      });
      </script>

      in your header.php

    • 11/27/11 6:06am

      HarriL says:

      Great. I'll have to head out but I'll be back within a couple of hours and will test it then and then reward you with the money. Thanks.

    • 11/27/11 6:24am

      Manoj Raj says:

      Ya sure.

    • 11/27/11 11:09am

      HarriL says:

      Excellent. It's working.

  • avatar
    Last edited:
    11/27/11
    12:24am
    Christianto says:

    With this pluging you are only able to choose "Comments should be displayed with NEWER comments at the top of the page."


    Hi,

    I check the plugin and try it on my local installation with newest wordpress version, comments could be displayed with older comments at the top of the page so the newest comment are displayed at the bottom of the page...

    There is setting on settings -> discussion settings to change what to be displayed on top of the page (newer/older comment), right below ""Break comments into pages with 50 top level comments per page and the last page displayed by default."

    You can change the setting, no need to edit the plugin..
    Hope this help..

    • 11/27/11 12:40am

      Christianto says:

      Very strange...

      why on my wp local installation the comment can be easily sort from newer to older at top of page...
      The developer said it couldn't.. :D

      What wordpress version that you use?

  • avatar
    Last edited:
    11/27/11
    4:29am
    Erez S says:

    As you can see here:
    http://codex.wordpress.org/Settings_Discussion_SubPanel
    You can change the order of comments as like Chrisitiano said.
    If you can't see that option then try to upgrade your wordpress to the latest version.

    Anyway you can also do that using the wp_list_comments function. if you will attach here your comments.php I'll be able to help you more, but this is something like that:


    <?php
    $args = array(
    'per_page' => 50,
    'reverse_top_level' => false
    );
    wp_list_comments( $args );
    ?>

    Previous versions of this answer: 11/27/11 at 4:29am

    • 11/27/11 4:48am

      HarriL says:

      Read the plugin page closely so you'll really understand my problem.
      http://winkpress.com/articles/fix-reversed-comments-pagination/

      So let's say you have a post with 6 comments. comment number 1 being the oldest and 6 the newest.

      Now you break comments into pages with 5 comments per page.
      Now on the main post page you should now have 1 comment showing. Newest one, comment number 6. Then there's "older comments" link and clicking it shows you the 5 older comments.

      What I would like is that on the main post page there's 5 NEWEST comments showing. Newest at the end. So main post page would show comments 2-6 and clicking "Older comments" gives you comment number 1.

      If you get comment number 7, now you would have main post page showing comments 3-7 and comments one and two are in the "Older Comments" page.

  • avatar
    Last edited:
    11/27/11
    7:45am
    Utkarsh Kukreti says:

    So if you have 7 comments (like in the example above), you want them to show up in this order?

    Main page:
    3
    4
    5
    6
    7 -> newest comment
    Second page
    1 -> oldest comment
    2

    or

    Main Page
    7
    6
    5
    4
    3
    Second page
    2
    1

    Previous versions of this answer: 11/27/11 at 7:45am

This question has expired.



Gabriel Reguly, Julio Potier, Luis Abarca, Francisco Javier Carazo Gil, HarriL voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.