'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_do_not_get_duplicates; // set the variable to an array - if it's not already. if ( ! is_array( $best_do_not_get_duplicates ) ) { $best_do_not_get_duplicates = 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_do_not_get_duplicates[] = get_the_ID(); ?>