[Support request] Comment Pagination now working properly on GP Premium

Home Forums Support [Support request] Comment Pagination now working properly on GP Premium

Home Forums Support Comment Pagination now working properly on GP Premium

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #653240
    Vijaykumar

    I have enabled comment pagination functionality in WordPress settings. I am having the following settings for showing comments in WordPress Discussion settings.

    Break comments into pages with 25 top level comments per page and the LAST page displayed by default.
    Comments should be displayed with the OLDER comments at the top of each page

    But the post is showing only last few comments instead of last (new) 25 comments on post load.

    E.g On the URL I provided in website URL section of this comment, I have 27 comments for this post. So on post-load, it should have shown the last 25 comments and remaining 2 comments on the ‘Older comments’ page. But it doing exactly the opposite. Only showing last new 2 comments on post load and 25 comments on ‘Older comments’ link i.e comments page 1.

    Can you please provide a fix for this.

    #653581
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    GP/GP Premium shouldn’t have any affect on comments or comment pagination.

    Maybe try deactivating your other plugins to rule out a possible plugin conflict?

    #653599
    Vijaykumar

    Hi Tom
    It’s not plugin dependent. Pagination in other websites with the options I mentioned, is working when I check it.

    The issue is:
    If there are 12 comments on a post and if pagination is set to show 10 comments per page it’s just grouping the old 10 comments for the 2nd page and remaining new 2 comments for the current page. I just wanted to check if this grouping of comments per page is reversed or can we reverse it by anyway to show last 10 comments by default on page load and “Older comments” page 1 will show remaining 2 old comments.

    #653889
    Tom
    Lead Developer
    Lead Developer

    So have you gone to “Settings > Discussion” and set it to display the newer comments at the top? And it’s not working?

    #653904
    Vijaykumar

    yes already done that as well.

    In above example of 12 comments, it’s just showing the last 2 comments on post-load. Instead of, last 10 comments on page load and remaining 2 older comments on page 1.

    I hope you got the issue. The issue is of grouping the comments by pages.

    In the above example, Currently, it’s grouping Comment #1 to Comment #10 on Page 1 and Comment #11 and #12 on page load.
    But if I am setting it to show 10 comments per page, on page load, it should show the last 10 comments i.e from Comment #3 to comment #12 on page load and #1 and #2 on comment-page-1.

    #654682
    Tom
    Lead Developer
    Lead Developer

    I see now – that’s really strange. It happens in the Twenty Seventeen theme as well.

    It may be worth asking the moderators over on WP.org: https://wordpress.org/support/forum/how-to-and-troubleshooting/

    They’ve likely been asked this before and have an answer/solution. I’d be very interested in hearing what they have to say 🙂

    #654749
    Vijaykumar

    Good. I found the fix
    https://wordpress.org/plugins/fix-reversed-comments-pagination/

    But it’s not working as it’s very old and might need some tweaks. Can you have a look and send me the updated function/hook or code to update in the comments.php file?

    #654807
    Leo
    Staff
    Customer Support

    Have you contacted WordPress support as Tom suggested?

    If it’s happening in Twenty Seventeen then it should be a WordPress bug.

    I would be surprised they suggested using a plugin to fix it.

    Let us know 🙂

    #655807
    Vijaykumar

    Hi Leo
    I’ve logged a ticket on WordPress but it’s a long process of months to get the fix for self-hosted sites. Considering the SEO effect due to this, I can’t keep loading fewer comments. Also, can’t revert to earlier theme now as I have made all the changes.

    If you can provide a quick fix it would be great.

    Need just a change in the current process of grouping comments in pages.

    A quick example of the fix in simple words:
    If there are 6 comments on a post and I am showing 5 per page it’s showing
    comment #6 on post-load and comments #1,2,3,4,5 on comments-page-1.
    Instead of showing comments #2,3,4,5,6 on page load and comment #1 on comments-page-1.

    #1 – oldest comment
    #6 – Latest comment

    #655900
    Leo
    Staff
    Customer Support

    Unfortunately providing support/solution to what it looks a WordPress bug is a bit out of the scope of this forum.

    Did they reply and indicated that it takes months to fix? As Tom said they’ve likely been asked this before and have an answer/solution.

    I checked the forum quickly and looks like they reply regularly.

    #656376
    Vijaykumar

    I posted it there but getting replies saying this is intended behavior and can be changed as per the requirements of the theme 🙁

    #657040
    Tom
    Lead Developer
    Lead Developer

    I wonder if something like this would work:

    add_filter( 'comments_array', function( $comments ) {
        return array_reverse( $comments );
    } );
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.