<?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 Two-->
<section class="testimonial-section-two grey-bg">
	<div class="auto-container">
		<!--Sec Title-->
		<div class="sec-title grey-border 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();
			$state = buildark_set( $testimonial_meta, 'state' );
			$rating = buildark_set( $testimonial_meta, 'testimonial_rating' );
			?>
			
				<!--Testimonial Block Two-->
				<div class="testimonial-block-two">
					<div class="inner-box">
						<div class="quote-icon">
							<span class="icon flaticon-left-quote"></span>
						</div>
						<div class="text"><?php echo wp_trim_words( get_the_content(), $text_limit ); ?></div>
						<div class="lower-box clearfix">
							<div class="author-info pull-left">
								<div class="author-inner">
									<div class="image">
										<?php the_post_thumbnail( 'buildark_70x70', array( 'class' => 'img-responsive' ) );  ?>
									</div>
									<h3><?php the_title();  ?></h3>
									<div class="author-location"><?php echo wp_kses_post( $state ); ?></div>
								</div>
							</div>
							<div class="pull-right">
								<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>
							</div>
						</div>
					</div>
				</div>
				
			<?php endwhile; ?>

		</div>

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




<?php endif; ?>

<?php wp_reset_postdata();