Comment Pagination Behavior wp_list_comments() – comment ordering and pagination


I am using wp_list_comments with a callback function to display a list of all comments, and it’s working well.

I am then using paginate_comments_links to create pagination links, which is also working well.

My issue is with comment ordering and pagination.

In the WordPress discussion settings, I have…

Break comments into pages with 10 top level comments per page and the last page displayed by default
Comments should be displayed with the newer at the top of each page.

And this almost works exactly the way I want.

If I have, say, 50 comments, then the page will be broken down into 5 pages. The “last” page will have defaulted, and the comment order will be from most recent to oldest. Perfect!

The problem is that if someone now posts comment #51, then this comment goes to its own page. And since the last page is defaulted, this means that when someone goes to the main page, they will ONLY see this one comment, and have to go back a page to see the previous 10, instead of the last page auto filling to 10.

Anyone have any ideas on what to do?

, Harmonic 3 years 2019-12-07T10:24:26-05:00 0 Answers 98 views 0

Leave an answer