I want to use the query_posts() function to limit the posts to all but the most recent on one of my templates. This is because the most recent post is a featured item alone on it's own page where as the rest of the posts are to be on another page. It was easy enough to display the most recent one on one of my templates:

<?php query_posts(array('category_name' => 'Recipe of the Week', 'posts_per_page' => 1)); ?>

So basically I'd like something like that but to limit it to all but the first post.

Thanks, John.

2 Answers 2


I had to use the WP_Query class:

$the_query = new WP_Query(array( 'category_name' => 'Recipe of the Week', 'offset' => 1 )

And then reference my new query object in the template like this:

<?php while ( $the_query-> have_posts() ) : $the_query->the_post(); ?>

'Recipe of the Week', 'posts_per_page' => -1, 'offset' => 1)); ?>

I think this might do it.. just testing.

  • 1
    No, it didn't work :(
    – John Hunt
    Commented May 31, 2011 at 2:18
  • This is not a "classic" forum. You can edit your existing answers to include new information. It is a bit confusing if you add multiple answers. I suggest you delete this answer and write everything in the other answer.
    – Jan Fabry
    Commented May 31, 2011 at 7:02
  • seems to be indeed a weird behaviour; when i used a ridiculous large number, i.e. 'posts_per_page' => 9999 the offset worked.
    – Michael
    Commented May 31, 2011 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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