How to exclude the most recent post from your query results

Let’s say you’re featuring your most recent post in its own space on your page and you want to show excerpts of previous posts elsewhere on that same page. You don’t want your latest post to show up twice, so you’ll need to remove it from the second query. Add ‘offset’ to your query and tell it how many posts to omit. Like this…

query_posts( array( 'posts_per_page' => 5, 'offset' => 1 ) );

That code is telling your loop to display 5 posts,but to omit the most recent one. Your page will display posts 2-6.

Questions? Comment.

Jeff Roberts Web Design
7700 Howe Drive
Prairie Village, KS 66208

Copyright 2018. All Rights Reserved.