Custom Category Pagination shows countless blank (empty) pages
-
I have a category that consists of 14 pages. But there is a problem. Once you reach /page/14/, you can open blank pages 15, 16, 17, 20, 100, 200 and so on. I would like after page 14, visitors to be able to only see “404 not found”. How can I do that?
<?php $wp_query = new WP_Query(array( 'category_name' => 'blog', 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 20, 'paged' => get_query_var('paged') )); if ( get_previous_posts_link() ) { ?> <link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>" /><?php } if ( get_next_posts_link() ) { ?> <link rel="next" href="<?php echo get_pagenum_link( $paged +1 ); ?>" /><?php } ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Custom Category Pagination shows countless blank (empty) pages’ is closed to new replies.