Support » Plugin: WP-Paginate » Support for numbered comment pagination?

  • Resolved Tooni

    (@tooni)


    I installed this plugin because I want my paginated comments pages to have a numbered navigation (instead of prev/next). Unfortunately I cannot find a corresponding setup.

    Can you please give some short advise? Or doesn’t this plugin support this function?

    Regards, Tooni

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author AlanP57

    (@alanp57)

    As explained in the plugin’s readme file, one has to replace the old comment code with a new function. This is not difficult. First determine what theme your site is using. Next, you want to edit one of that theme’s files. This is usually the comments.php file which can be found in your theme’s folder. Make or save a copy of the comments.php file so if you make an editing mistake, you can easily restore the file. Edit comments.php and find the part of the file that contains ‘previous_comments_link’ and ‘next_comments_link’ functions.

    This code looks like that in a theme:

    <div class="nav-previous">< ?php previous_comments_link( __( '&larr; Older Comments', 'my-example-theme' ) ); ?></div>
    <div class="nav-next">< ?php next_comments_link( __( 'Newer Comments &rarr;', 'my-example-theme' ) ); ?></div>

    You can remove these lines and replace them with:

    <?php if(function_exists('wp_paginate_comments')) {
        wp_paginate_comments();
    } ?>

    Now pagination should be displayed with you have a number of comments in a post.

    Thread Starter Tooni

    (@tooni)

    Thank you very much. This was very helpful and I think this could be the solution.
    But there are two problems:
    1. I’m using the “Highlight Search Terms” plugin, which adds the search terms to the url to highlight them, when the url is clicked. For those posts the comment pagination is also working fine, the numbered navigation is displayed correctly, but clicking on a page number doesn’t show any effect.
    2. Wouldn’t it be better to create a child theme for the modifications done in comments.php? If yes, is it enough to place just the modified comments.php into the child theme’s folder?

    Regards, Tooni

    Plugin Author AlanP57

    (@alanp57)

    It is probably not forming correct URLs.

    A for using a child theme, yes, you should create one and copy the modified comments.php file to it.

    Thread Starter Tooni

    (@tooni)

    Thank you for your answer. So I will have to check this with the other plugin’s author.

    Regards, Tooni

    Thread Starter Tooni

    (@tooni)

    Just to keep you informed: This issue has been solved by the other plugin’s author.
    Thank you for your advise.

    Regards, Tooni

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.