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

Is there a way to query for the first three recent posts and then change how they display on the front page?

I want the first three posts of my blog to show differently than the rest of them i.e. they will have full images, and my other posts will just have thumbnail previews.

Thanks for any help in the matter.

share|improve this question
up vote 2 down vote accepted

You can style the first 3 posts differently without querying them separately, you just need to check where you are within the loop while outputting each post via the built in current_post var.

while( have_posts() ):

    // are we on the first page and outputting one of the first 3 posts?
    if( !is_paged() && $wp_query->current_post < 3 ):
        // output full image, etc..
        // not first page and not first 3 posts
        // output just thumb, etc..

share|improve this answer
Thanks a bunch, that is pretty simple! – Romes Apr 9 '13 at 2:01

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.