• Resolved battx0726

    (@battx0726)


    Hello everyone!

    I’m wondering if there is any chance you can exclude the first 3 recent posts on your homepage? I am currently building a blog page where my sub-header has this slider showing the first 3 recent posts.

    What I wanted to do now is I don’t want to show those first 3 recent posts on the loop since they are already on my slider. Is this possible?

    Any help would be greatly appreciated.

    Thanks! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • some techniques for excluding duplicate posts:

    http://codex.wordpress.org/The_Loop#Multiple_Loops_in_Action

    is the slider also there on ‘paginated’ pages?

    alternatively, you could just try and add a line after the beginn of the loop ( after this bit <?php while (have_posts()) : the_post(); ?> ):

    <?php if( is_home() && !is_paged() && $wp_query->current_post <= 2 ) continue; ?>

    this would simply skip the first three posts on the front/posts page, i.e. there would be three posts less in the ‘normal’ loop.

    tails depend on your theme;
    totally untested.

    http://codex.wordpress.org/Conditional_Tags

    you could just try and add a line after the beginn of the loop ( after this bit <?php while (have_posts()) : the_post(); ?> ):

    <?php if( is_home() && !is_paged() && $wp_query->current_post <= 2 ) continue; ?>

    Thread Starter battx0726

    (@battx0726)

    Wow, it worked perfect! 🙂 You are awesome! Thanks so much for your help! Though I don’t have the slider on the paginated pages, I was trying to figure this out for 5 hours. I’m just new in php, but thanks again, alchymyth! You rock! 🙂

    Thread Starter battx0726

    (@battx0726)

    thanks haider242! just got it worked!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to exclude the first 3 added posts from your homepage?’ is closed to new replies.