How can I see all of a post’s comments on a single page as a reader, if pagination is enabled?

Just build a link that has some query args: printf( ‘<a href=”http://example.com/all-comments?pid=%s”>All comments</a>’ ,get_the_ID() ); Then add a page with a a permalink of all-comments, so you have something to target. There you attach a template like the following (just a base to work off): <?php /** * Template Name: All Comments */ // Abort … Read more

Custom WP_Comment_Query with pagination and orderby?

The goal was to paginate comments, showing comments with the highest comment_rating meta value first. Thanks to the answer of cjbj and the comments by Milo and birgire I figured out the rather unintuitive solution to the issue. By using numberand offset I was able to make the results in the proper order, but pagination … Read more

Strange paginate_links behavior. First page link is always whatever page I’m on, all other links are correct

Short answer: Try ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) ) ), ‘format’ => ‘?paged=%#%’, Long answer: I took a look at the paginate_links() source code (v3.5.1) and there is this line (#) $link = str_replace(‘%_%’, 1 == $n ? ” : $format, $base); that is giving you the empty first page link. … Read more

Implementing a general Table of Content across single paginated post pages

Just inspect the current post content for <!–nextpage–>: function wpse_check_multi_page() { $num_pages = substr_count( $GLOBALS[‘post’]->post_content, ‘<!–nextpage–>’ ) + 1; $current_page = get_query_var( ‘page’ ); return array ( $num_pages, $current_page ); } On page 2 of 3 that returns: Array ( [0] => 3 [1] => 2 ) On an unpaged post it returns: Array ( … Read more