<?php
$query_args = array('post_type' => 'bunch_team', 'showposts' => $num , 'order_by' => $sort , 'order' => $order);
if( $cat ) $query_args['team_category'] = $cat;
$query = new WP_Query($query_args) ; 
?>

<?php if($query->have_posts()):  ?> 


<!--Team Section-->
<section class="team-section">
	<div class="auto-container">
		<!--Sec Title-->
		<div class="sec-title">
			<h2><?php echo wp_kses_post( $title );  ?></h2>
		</div>
		<div class="three-item-carousel owl-carousel owl-theme">
		
			<?php while($query->have_posts()): $query->the_post(); global $post;
            	$team_meta = _WSH()->get_meta(); 
				$ex_url = buildark_set( $team_meta, 'team_link' );
            ?>
			
				<!--Team Member-->
				<div class="team-member">
					<div class="inner-box">
						<div class="image">
							<?php the_post_thumbnail( 'buildark_370x220', array( 'class' => 'img-responsive' ) );  ?>
							<div class="overlay-box">
							
								<?php if ( $socials = buildark_set( $team_meta, 'bunch_team_social' ) ):?>
                                <ul class="social-icon-two">
                                    <?php foreach( $socials as $key => $value ) :?>
                                        <li><a href="<?php echo esc_url( buildark_set( $value, 'social_link' ) );?>"><span class="fa <?php echo esc_attr( buildark_set( $value, 'social_icon' ) );?>" aria-hidden="true"></span></a></li>
                                    <?php endforeach;?>
                                </ul>
                            	<?php endif;?>
							</div>
						</div>
						<div class="lower-content">
							<h3><a href="<?php echo esc_url( $ex_url ); ?>"><?php the_title(); ?></a></h3>
							<div class="designation"><?php echo wp_kses_post( buildark_set( $team_meta, 'designation' ) ); ?></div>
							<div class="text"><?php echo wp_trim_words( get_the_content(), $text_limit ); ?> </div>
						</div>
					</div>
				</div>
			
			<?php endwhile;  ?>
			
		</div>
	</div>
</section>
<!--End Team Section-->

<?php endif;
wp_reset_postdata();