<?php  
   $count = 1;
   $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) ; 
   
   ob_start() ;?>
   
<?php if($query->have_posts()):  ?>   

<!--Testimonials Section-->
<section class="testimonials-section style-two" style="background-image:url('<?php echo esc_url(wp_get_attachment_url($bg_img));?>');">
	<div class="auto-container">
        <!--Section Title-->
        <div class="sec-title text-center">
            <div class="subtitle-text"><?php echo balanceTags($upper_title);?></div>
            <h2><strong><?php echo balanceTags($title1);?></strong> <?php echo balanceTags($title2);?></h2>
        </div>

        <div class="testimonials-carousel">
        	<?php while($query->have_posts()): $query->the_post();
				global $post ; 
				$testimonials_meta = _WSH()->get_meta();
			?>
            <!--Slide Item-->
            <div class="slide-item">
                <div class="inner-box">
                    <div class="quote-icon"><span class="fa fa-quote-right"></span></div>
                    <div class="content">
                        <h3 class="review-title"><?php the_title();?></h3>
                        <div class="text"><?php echo balanceTags(tycheproperty_trim(get_the_content(), $text_limit));?></div>
                        <div class="info clearfix">
                            <div class="author-thumb"><?php the_post_thumbnail('36x36');?></div>
                            <div class="author-title"><?php echo (tycheproperty_set($testimonials_meta, 'designation'));?></div>
                        </div>
                    </div>
                </div>
            </div>
            <?php endwhile;?>
        
        </div>
    </div>
</section>

<?php endif; ?>
<?php 
	wp_reset_postdata();
   $output = ob_get_contents(); 
   ob_end_clean(); 
   return $output ; ?>