- This topic has 11 replies, 3 voices, and was last updated 5 years, 8 months ago by Tom.
-
AuthorPosts
-
August 19, 2018 at 12:39 am #653240Vijaykumar
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 pageBut 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.
August 19, 2018 at 8:53 am #653581TomLead DeveloperLead DeveloperHi 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?
August 19, 2018 at 9:12 am #653599VijaykumarHi 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.August 19, 2018 at 8:33 pm #653889TomLead DeveloperLead DeveloperSo have you gone to “Settings > Discussion” and set it to display the newer comments at the top? And it’s not working?
August 19, 2018 at 9:08 pm #653904Vijaykumaryes 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.August 20, 2018 at 10:24 am #654682TomLead DeveloperLead DeveloperI 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 🙂
August 20, 2018 at 11:07 am #654749VijaykumarGood. 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?
August 20, 2018 at 12:10 pm #654807LeoStaffCustomer SupportHave 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 🙂
August 21, 2018 at 8:19 am #655807VijaykumarHi 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 commentAugust 21, 2018 at 9:28 am #655900LeoStaffCustomer SupportUnfortunately 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.
August 21, 2018 at 9:23 pm #656376VijaykumarI posted it there but getting replies saying this is intended behavior and can be changed as per the requirements of the theme 🙁
August 22, 2018 at 10:19 am #657040TomLead DeveloperLead DeveloperI wonder if something like this would work:
add_filter( 'comments_array', function( $comments ) { return array_reverse( $comments ); } );
-
AuthorPosts
- You must be logged in to reply to this topic.