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

Pre get posts for single post

First of all, $query object is passed by reference, you don’t need to return $query in pre_get_posts. Second, is_post_type_archive( ‘events’ ) will work just fine, you don’t need to use query->query_vars[]. Corrected code will look like this: function my_pre_get_posts( $query ) { if( ! is_admin() && is_main_query() && is_post_type_archive( ‘events’ ) ) { $query->set(‘orderby’, ‘meta_value_num’); … Read more

Single Page View for Paginated Posts

Yes, it is possible, and I use it on my own site. Here it is in action: my Settings API post is paginated, but can viewed on a single page, using the “Single-Page View” link. First, you need to prepare a custom query variable, e.g. in functions.php, add the following: function cbnet_parameter_queryvars( $qvars ) { … Read more

Disable wordpress pagination URL rewrite for specific page

The redirect_canonical filter is responsible for this, which you can selectively disable depending on the requested page. This is untested, but should work: function wpa66273_disable_canonical_redirect( $query ) { if( ‘design-jobs’ == $query->query_vars[‘pagename’] ) remove_filter( ‘template_redirect’, ‘redirect_canonical’ ); } add_action( ‘parse_query’, ‘wpa66273_disable_canonical_redirect’ );