How to display first post

I want to display in the front page of my theme the first most recent post in the header and then continuing the loop in the main content section starting from the second to post and so on, how can i achieve this?

Related posts

2 comments

  1. Calling the_post() is what advances the internal current_post counter that have_posts() checks the value of within the loop.

    With this in mind, you can call the_post() once outside the loop and use any template tags you wish, then run the loop as normal and it will pick up and continue from the second post.

    the_post();
    // this is the first post!
    the_title();
    
    // now the loop
    while ( have_posts() ) :
        the_post();
        // starts at 2nd post
        the_title();
    endwhile;
    

Comments are closed.