• Hi,

    I updated my dev system from 4.0 to 4.1 yesterday, and everything seems to be ok except comments pagination. With paginate_comments_links() in my comments template I’m getting a perfect result of links on the 1st comments page, but not on subsequent pages. All links on the 2nd page (previous and ‘1’) link to the 2nd page instead of the 1st one.

    I think this worked on 4.0, but I’m not sure. Maybe I only tested one direction.

    None of the major themes uses paginate_comments_links(). Can anyone confirm paginate_comments_links() still working properly on 4.1?

    Using previous_comments_link() and next_comments_link() works as expected, but I want a better user experience.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Demokrit

    (@demokrit)

    Update: This problem seems to be related to permalink settings. It strikes on the default (https://www.mydomain.com/?p=123), but not on any of the alternatives.

    My problem seems to be related to:

    'base' => add_query_arg( 'cpage', '%#%'

    This is happening with me as well.

    I have 50 comments per page. I have three pages of comments. Users enter the page and see comments 101-149. They click “prev” to get to page 2 of comments, and all three items point to page 2 of comments, not to page 1, page 2, and page 3. next goes to page 2.

    It can be seen here: HELP!

    https://steadfastlutherans.org/?p=39951

    Here is an extract from comments.php in my theme (modified from inove; a theme I found several years ago)

    <?php
    if (get_option(‘page_comments’)) {
    $comment_pages = paginate_comments_links(‘echo=0&total=5’);
    if ($comment_pages) {
    ?>
    <div id=”commentnavi”>
    <span class=”pages”><?php _e(‘Comment pages’, ‘inove’); ?></span>
    <div id=”commentpager”>
    <?php echo $comment_pages; ?>
    <span id=”cp_post_id”><?php echo $post->ID; ?></span>
    </div>
    <div class=”fixed”></div>
    </div>
    <?php
    }
    }
    ?>

    I’ve given up on getting a fix for this and switched to using previous / next comment instead of having a list of pages using “paginate_comments_links”.

    If this gets fixed please tell me and I’ll switch back to the better interface!

    Thread Starter Demokrit

    (@demokrit)

    Did you try a non-default permalink setting? I’m getting this error only with the default.

    Hi guys!! Same issue here!

    With the default permalink structure, since you link from first page to any other, all links of the pagination point to the current page.

    It works fine if you change to pretty permalinks.

    Any fix for that or we need to step back to next/previous comments links?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘paginate_comments_links() broken on 4.1?’ is closed to new replies.