'post', 'posts_per_page' => get_theme_mod( 'slider_limit', best_reloaded_setting_defaults( 'slider_limit' ) ), 'post__not_in' => get_option( 'sticky_posts' ), ); if ( get_theme_mod( 'slider_category', best_reloaded_setting_defaults( 'slider_category' ) ) ) { $args['category__in'] = get_theme_mod( 'slider_category', best_reloaded_setting_defaults( 'slider_category' ) ); } $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(); ?>