<?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">
	<div class="auto-container">
		<!--Sec Title-->
		<div class="sec-title centered">
			<h2><?php echo wp_kses_post( $title ); ?></h2>
		</div>
		<div class="two-item-carousel owl-carousel owl-theme">

			<?php
			while( $query->have_posts() ): $query->the_post();
			$testimonial_meta = _WSH()->get_meta();
			$designation = buildark_set( $testimonial_meta, 'designation' );
			$rating = buildark_set( $testimonial_meta, 'testimonial_rating' );
			?>
			
				<div class="testimonial-block">
				<div class="inner-box">
					<div class="content">
						<div class="image">
							<?php the_post_thumbnail( 'buildark_80x80', array( 'class' => 'img-responsive' ) );  ?>
						</div>
						<div class="rating">
							<?php
							for ( $x = 1; $x <= 5; $x++ ) {
          						if ( $x <= $rating ) {
									echo '<span class="fa fa-star"></span>';
								}
								else {
									echo '<span class="fa fa-star-o"></span>';
								}
          					}
							?>
						</div>
						<h3><?php the_title();  ?></h3>
						<div class="designation"><?php echo wp_kses_post( $designation ); ?></div>
						<div class="text"><?php echo wp_trim_words( get_the_content(), $text_limit ); ?></div>
					</div>
				</div>
			</div>
			
			<?php endwhile; ?>

		</div>
	</div>
</section>




<?php endif; ?>

<?php wp_reset_postdata();