'post', 'posts_per_page' => 3 - $sticky ); $loop = new WP_Query( $args ); $i = 0; // set a global to track post IDs we don't want output in other loops on this page global $best_doNotGetDuplicates; // set the variable to an array - if it's not already if( !is_array( $best_doNotGetDuplicates ) ){ $best_doNotGetDuplicates = array(); } if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); // store the post ID in global array for use in other loops in home template $best_doNotGetDuplicates[] = get_the_ID(); ?>