Lego2012
12/13/2016 - 9:22 AM

Template - Filter out duplicate posts in the WordPress Loop

Template - Filter out duplicate posts in the WordPress Loop

<?php
// Do NOT include the opening php tag

$do_not_duplicate = array(); 
    query_posts( 'cat=featured&showposts=6' ); while ( have_posts() ) : the_post(); 
    $do_not_duplicate[] = $post->ID;
    <!-- do stuff -->
endwhile; wp_reset_query();