WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Well, I think the question might be a bit confusing. But well, I want to get the recent 4 posts, ignoring the first five recent posts. So in short the sixth, seventh, eighth and ninth - most recent posts.

share|improve this question
up vote 1 down vote accepted


WordPress provides a function called get_posts() that lets you get posts in any order. Basically, get_posts() will retrieve the 5 most recent posts by default.

To get 4 posts, ignoring the 5 most recent, you'd set the numberposts and offset parameters - offset tells the function how many posts to skip.

$args = array(
    'numberposts' => 4,
    'offset'      => 5,
    'orderby'     => 'post_date',
    'order'       => 'DESC',
    'post_type'   => 'post',
    'post_status' => 'publish'

$posts = get_posts( $args );

Now you have an array of posts the 4 latest posts (ignoring the 5 most recent), ordered by date.

share|improve this answer

You can use the offset parameter - either on pre_get_posts hook (see this post) for the 'main Loop':

function wpse50761_alter_query($query){

      if( $query->is_main_query() ){
        //Do something to main query

Or for subsequent secondary loops:

 //Using get_posts
 $my_offset_posts = get_posts(array('offset'=>5));

 //Using WP_Query object
 $my_offset_query = new WP_Query( array('offset'=> 5) );

(Of course other argument can be included in the argument array)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.