I have a WordPress loop, that is part of an AJAX call. Every time a button is clicked, this function is called, runs the below loop and outputs the next 6 posts. There are already five posts shown by default. How can I exclude the five latest (most recent published) posts from the Wordpress loop? So that page 1 of the loop starts with the 6th, 7th, 8th, 9th, 10th & 11th post?
This is the loop that I use. It would be great if someone could tell me how to alter it so that it starts with the 6th post. Thanks in advance!
$args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => '4', 'paged' => $paged, //Starts with 1 (or a different number if that's better) ); $query = new WP_Query( $args ); ?> <?php if ( $query->have_posts() ) : ?> <?php while ( $query->have_posts() ) : $query->the_post();?> <div class="amb-home-post-single override"> <div class="amb-home-post-contents override"> <img class="amb-home-thumbnail-container override" src="<?php echo the_post_thumbnail_url(); ?>"> <h2><a href='<?php the_permalink() ?>'><?php the_title() ?></a></h2> <div class="amb-home-post content override"><?php the_excerpt() ?></div> </div> </div> <?php endwhile; ?> <?php endif;