-
-
Save nirbhay18/c43fbfef8a9d95384088f1b68aa7e384 to your computer and use it in GitHub Desktop.
Fix pagination issues on CPT Singular Layout Ref#17568
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _wp_adjust_show_request( $request ) { | |
if ($request->query_vars['post_type'] === 'project' && $request->is_singular === true && $request->current_post == -1 && $request->is_paged === true ) { | |
add_filter( 'redirect_canonical', '__return_false' ); | |
} | |
return $request; | |
} | |
add_action( 'parse_query', '_wp_adjust_show_request' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment