<?php ob_start(); ?>

<?php    $count = 1; 
$query_args = array('post_type' => 'sh_team' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order);

if( $cat ) $query_args['team_category'] = $cat;
$query = new WP_Query($query_args) ;  

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

				<div class="bg-secondary padding">
					<div class="container">	
						<header class="header-section wow fadeInDown" data-wow-duration="1.5s">
							<h2><?php echo balanceTags($title); ?></h2>
							<p><?php echo balanceTags($text); ?></p>
						</header> <!-- / .header-section -->

						<div class="row">

							<?php while($query->have_posts()): $query->the_post(); 

								$meta = _WSH()->get_meta();
								$link = sh_set($meta, 'link'); 
								$limit = ( $excerpt ) ? $excerpt : 10;
								$social = sh_set($meta, 'sh_team_social');?>

								<div class="col-md-3 col-sm-6">
									<div class="team-member wow fadeInUp" data-wow-delay="0s">

										<div class="team-member-img">
											<?php the_post_thumbnail('370x370'); ?>
										</div> <!-- / .team-member-img --> 

										<div class="caption">
											
											<?php if( $social ):?>

												<div class="social-icons">

													<?php foreach ($social as $key => $value):?>
														<a target="_blank" href="<?php echo esc_url(sh_set($value, 'social_link')); ?>" class="<?php echo esc_attr(sh_set($value, 'social_icon')) ?>"></a>
													<?php endforeach; ?>
												</div> <!-- / .social-icons-->
											
											<?php endif; ?>

											<?php if( $link ): ?>
												<h3 class="uppercase"><a href="<?php echo esc_url($link); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
											<?php else: ?>
												<h3 class="uppercase"><?php the_title(); ?></h3>
											<?php endif; ?>

											<span><?php echo balanceTags(sh_set($meta, 'designation')); ?></span>
											
											<p><?php echo _sh_trim(get_the_content(), $limit); ?></p>
										

										</div> <!-- / .caption-->

									</div> <!-- / .team-member-->
								</div> <!-- / .col-md-3 -->
							
							<?php endwhile; ?>

							
						</div> <!-- / .row -->
					</div>
				</div>

			<?php endif; ?>

<?php wp_reset_postdata();
return ob_get_clean();
