Pagination in plugin with custom post type
the_posts_pagination uses global query and global query does not have pagination. So it is the correct behavior of WordPress. To overcome from this problem assign custom query to global query then after looping again restore the global query. function foo($args){ $post_type = $args[‘post_type’]; global $wp_query; $original_query = $wp_query; $custom_post_type = new WP_Query( array( ‘post_type’ => … Read more