WP query not showing posts on page 2
-
I normal WP query where it skips the first post as that is elsewhere as the lead article.
This query then carries on from the second post and has 3 posts per page – but when I click page 2, its the same posts from page 1 (same for page 3 as well).
WP_Query arguments $args = array( 'nopaging' => false, 'paged' => '1', 'posts_per_page' => '3', 'offset' => '1', 'order' => 'DESC', 'orderby' => 'date', ); // The Query $query = new WP_Query( $args ); // The Loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); // do something ?> <div class="article article_cols"> <?php get_template_part( 'components/article' ); ?> </div> <?php } } else { // no posts found } // Restore original Post Data wp_reset_postdata();
I can’t understand why it’s doing this…
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WP query not showing posts on page 2’ is closed to new replies.