Site icon Hip-Hop Website Design and Development

How Can I take advantage of WP_Query to Solely Show 1 Put up from Customized Put up Kind if Question Returns Posts with Matching ID in Customized Area

I’ve searched excessive and low for an answer and could not discover something; hopefully somebody right here extra expert than myself can assist.

I’ve two testimonial movies (from a video customized submit sort) displayed randomly each time the web page masses. There are totally different purchasers which have testimonials and in some instances, there are a number of testimonials from the identical consumer.

I’ve the question working that randomly shows two movies from the customized submit sort (whereas filtering out a class fully). What I am making an attempt to keep away from is loading two testimonial movies from the identical consumer (seems odd to have two of the identical thumbnails present) however I am unsure how to do that. Right here the working code that I’ve to date:

  <?php  $loop = new WP_Query(array(
            'post_type' => 'video',
            'posts_per_page' => 2,
            'orderby' => 'rand',
            'tax_query' => array(
                array(
                'taxonomy' => 'video_category',
                'area' => 'slug',
                'phrases' => 'assess-core-certification',
                'operator' => 'NOT IN')
               )
              )               
             ); 


            ?>



            <?php if ( $loop ) : whereas ( $loop->have_posts() ) : $loop->the_post(); ?>  


                      <div  class="testimonialVideo high">

                    <div class="testimonialVideo-video"><?php the_content(); ?></div>

                   <div class="testimonialVideo-title">
                    <robust><?php echo get_post_meta( get_the_ID(), 'video_clientName', true ) ?></robust><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>
                <?php endwhile; else: ?>  

                <p class="error-not-found">Sorry, no testimonials discovered.</p>  

            <?php  endif; wp_reset_postdata();?>