Pagination breaks when page is set to front page?
-
So I’m noticing some very strange behavior.
Pagination breaks inside my front-page.php on page 3. Instead of page 3, I get thrown onto the index page.
<?php $args = array( 'post_type' => 'food', 'posts_per_page'=>9, 'paged' => $paged, ); $wp_query = new WP_Query( $args ); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <?php the_title() ;?> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php previous_posts_link('Prev') ?> <?php next_posts_link('Next') ?>
But when testing this code inside of a normal page template, the pagination works just fine.
Also, a strange quirk that might divulge some more information… For some reason if I change the reading settings to “Blog pages show at most [5]”, the 3rd page seems to work but not the 4th page.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pagination breaks when page is set to front page?’ is closed to new replies.