How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field

It seems like you need to actually prevent two specific VIDEOS from displaying on the same screen (not preventing videos from the same CLIENT twice), but if I’m wrong you can still adapt this. The idea is to push each VIDEOS identifier (name, id, whatever) to an array as you output it, checking each item against the array to see if it is already displayed on the page. If it is, skip it, if not – display it an add it to the list to prevent displaying again.

This is what I did to avoid dupes for a randomly displayed advertisement plugin, and had a global variable containing image ids which I checked against each time an ad item was chosen to be randomly displayed.

Other options include using meta_query (see WP_Query docs in codex) and a custom SQL query, both of which seem overly complex in my opinion. I’m not sure WP_Query can return unique results in a set of metadata or not.

Your code adapted (I haven’t tested this code):

<?php $test_meta_list = array(); // array to hold item names that have been displayed ?>
<?php if ( $loop ) : while ( $loop->have_posts() ) : $loop->the_post();

// Get the video meta
$test_meta = get_post_meta( get_the_ID(), 'video_clientCompany', true )

// If it has already been output, skip it
if ( in_array($test_meta, $test_meta_list) ) 
  continue();
// If not, add it to the list and output it
else {
  array_push($test_meta_list, $test_meta)
?>

<div  class="testimonialVideo top">
 <div class="testimonialVideo-video"><?php the_content(); ?></div>
   <div class="testimonialVideo-title">
     <strong><?php echo get_post_meta( get_the_ID(), 'video_clientName', true ) ?></strong><br/>
     <span class="small"><?php echo get_post_meta( get_the_ID(), 'video_clientCompany', true ) ?><br/><br/>
     "<em><?php echo get_post_meta( get_the_ID(), 'video_shortQuote', true ) ?></em>"
     </span>
   </div>
 </div>
</div>
<?php } endwhile; else: ?>  

tech