[Support request] Pagination for Comments with Page Numbers in Generate Press

Home Forums Support [Support request] Pagination for Comments with Page Numbers in Generate Press

Home Forums Support Pagination for Comments with Page Numbers in Generate Press

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1654344
    BHASKAR

    We have a unique situation with thousands of comments on one of our sites that is using X theme.
    Some pages have 2000 or more comments. We have paginated them in 100 pages per page using some code.

    We want to move that to Generatepress. Would like to understand how to get the same pagination effect or page numbers with Generatepress theme. In fact, this is our key requirement to migrate.

    Here is example : https://drive.google.com/file/d/1dige0uZnqpqmYxPCde-MVWPTM3ZMYCFr/view

    Please suggest.

    #1654617
    David
    Staff
    Customer Support

    Hi there,

    GP uses the standard WP Comments form.
    To add pagination you would need to copy the comments.phpto a child theme:

    https://github.com/tomusborne/generatepress/blob/master/comments.php

    Then you’d replace this:

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

    With this:

    <?php paginate_comments_links( array('prev_text' => '&lsaquo; Previous', 'next_text' => 'Next &rsaquo;')); ?>

    #1655638
    BHASKAR

    Hello,
    Thanks for the reply. It worked.
    Initially, I did a mistake only replacing it in one place and did not work.
    Then, I replaced in two places, it worked.

    #1655957
    David
    Staff
    Customer Support

    Glad to hear that!

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