<?php
/*
Template Name: Team
*/
?>

<div class="row bottom">

<?php
$temp = $wp_query;
$wp_query = null;

$column_counter = 0;
$top_position = 0;
$wp_query = new WP_Query(array(
  'post_type' => 'team',
  'orderby'=> 'menu_order'
));
      
while ($wp_query->have_posts()) : $wp_query->the_post();
  $related_thumb = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'team-member' );
  $sub_title = get_post_meta( $post->ID, '_team_subtitle_value', true );
?>
<div class="span4 members-item" style="top: <?php echo $top_position; ?>px;">
  <div class="members-item-content">
    <img src="<?php echo $related_thumb[0]; ?>" alt="<?php the_title(); ?>" />
    <div class="members-item-move">
    <div class="members-item-content-bottom">
      <div class="line"></div>
      <h4 class="title"><?php the_title(); ?></h4>
      <span class="sub-title"><?php echo $sub_title; ?></span>
    </div>
    <div class="hover">
    <div class="hover-bottom">
     
      <?php the_content(); ?>
      <ul class="social unstyled">
        <?php 
        $social_links_arr = array( 'facebook', 'twitter', 'google-plus', 'linkedin', 'tumblr', 'dribbble' );

        foreach ( $social_links_arr as $social_link ) {
          if ( get_post_meta($post->ID, '_team_social_'.$social_link.'_value', true) ) {
            echo '<li><a href="'.get_post_meta( $post->ID, '_team_social_'.$social_link.'_value', true ).'" target="_blank"><i class="fa fa-'.$social_link.'"></i></a></li>';
          }
        }
        ?>
      </ul>
      <div class="clearfix"></div>
    </div>
    </div>
  </div>
  </div>
</div>

<?php 
$column_counter++;
if($column_counter > 2) {
  $column_counter = 0;
}
$top_position = $column_counter * 40;
endwhile; 
// end of the loop. ?>
         
<?php $wp_query = null; $wp_query = $temp;?>

</div>
    