<?php
$query_args = array( 'post_type' => 'bunch_testimonials' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order );
if( $cat ) $query_args['testimonials_category'] = $cat;
$query = new WP_Query($query_args) ; 
?>
<?php if( $query->have_posts() ) :  ?>

<!--Testimonial Section-->
<section class="testimonial-section-three">
	<div class="auto-container">
		<!--Sec Title-->
		<div class="sec-title centered">
			<h2><?php echo wp_kses_post( $title );  ?></h2>
		</div>

		<div class="testimonial-outer">
			<div class="quote-icon">
				<span class="quote"></span>
			</div>
			<!--Client Testimonial Carousel-->
			<div class="client-testimonial-carousel owl-carousel owl-theme">
				
				<?php while( $query->have_posts() ): $query->the_post(); ?>

					<!--Testimonial Block One-->
					<div class="testimonial-block-one">
						<div class="inner-box">
							<div class="text"><?php echo wp_trim_words( get_the_content(), $text_limit );  ?></div>
						</div>
					</div>
				
				<?php endwhile; ?>

			</div>

			<!--Product Thumbs Carousel-->
			<div class="client-thumb-outer">
				<div class="client-thumbs-carousel owl-carousel owl-theme">
				
					<?php
						while( $query->have_posts() ): $query->the_post();
						$testimonial_meta = _WSH()->get_meta();
						$designation = buildark_set( $testimonial_meta, 'designation' );
					?>
				
						<div class="thumb-item">
						<figure class="thumb-box">
							<?php the_post_thumbnail( 'buildark_90x90', array( 'class' => 'img-responsive' ) );  ?>
						</figure>
						<div class="thumb-content">
							<h3><?php the_title(); ?></h3>
							<div class="designation"><?php echo wp_kses_post( $designation );  ?></div>
						</div>
					</div>
					
					<?php endwhile; ?>
					
				</div>
			</div>

		</div>

	</div>
</section>
<!--End Testimonial Section-->


<?php endif;
wp_reset_postdata();