<?php
/*
 * Templatation.com
 *
 * Hero block box shortcode for VC
 *
 */
$alignment  = $heading = $content = $image = $color = $text_appear = $yoast_bdcmp = $block_padding_top = $block_padding_bottom = '';
$text_appear = 'light';
$yoast_bdcmp = false;

$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );
?>
<section class="team-section sec-padding">
    <div class="thm-container">
        <div class="sec-title">
            <h2><span><?php echo htmlspecialchars_decode($title); ?></span></h2>
        </div>
        <div class="row">
            <?php
                        $args = array(
                            'post_type' => 'tt-team',
                            'posts_per_page' => $number,
                            'order' => $orderpost,
                            'orderby' => $orderby,
                        );
                        $tt_query = new WP_Query($args);
                        while ($tt_query -> have_posts()) : $tt_query -> the_post();
                        $single_data4 = get_post_meta( get_the_ID(), '_tt_meta_page_opt', true );
                        $facebook = $twitter =  $google =  $linkedin = $contact = '';
                        if( is_array($single_data4) ) {
                            if ( isset( $single_data4['_single_team_facebook'] ) ) $facebook = esc_attr($single_data4['_single_team_facebook']);
                            if ( isset( $single_data4['_single_team_twitter'] ) ) $twitter = esc_attr($single_data4['_single_team_twitter']);
                            if ( isset( $single_data4['_single_team_google'] ) ) $google = esc_attr($single_data4['_single_team_google']);
                            if ( isset( $single_data4['_single_team_linkedin'] ) ) $linkedin = esc_attr($single_data4['_single_team_linkedin']);
                            if ( isset( $single_data4['_single_team_email'] ) ) $contact = esc_attr($single_data4['_single_team_email']);
                        }
                    ?>
            <div class="col-md-3 col-sm-6">
                <div class="single-team-member img-cap-effect">
                    <div class="img-box">
                        <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id());?>" alt="Awesome Image"/>
                        <div class="img-caption">
                            <div class="box-holder">
                                <ul>
                                <?php if($facebook != ''){?>
                                <li><a href="<?php echo esc_url($facebook);?>"><i class="fa fa-facebook"></i></a></li>
                                <?php }?>
                                <?php if($twitter != ''){?>
                                <li><a href="<?php echo esc_url($twitter);?>"><i class="fa fa-twitter"></i></a></li>
                                <?php }?>
                                <?php if($google != ''){?>
                                <li><a href="<?php echo esc_url($google);?>"><i class="fa fa-google-plus"></i></a></li>
                                <?php }?>
                                <?php if($linkedin != ''){?>
                                <li><a href="<?php echo esc_url($linkedin);?>"><i class="fa fa-linkedin"></i></a></li>
                                <?php }?>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="content">
                        <div class="name-box">
                            <h3><?php the_title();?></h3>
                            <span><?php the_terms( $ID, 'position', '', ' / ' ); ?></span>
                        </div>
                        <?php the_content(); ?>
                    </div>
 				<a href="mailto:<?php echo sanitize_email($contact); ?>" class="readmore"><?php echo esc_attr($tt_temptt_opt['team_contact']);?><i class="fa fa-long-arrow-right"></i></a>
                   <a href="<?php echo esc_url($contact);?>" class="readmore"><?php echo esc_attr($tt_temptt_opt['team_contact']);?> <i class="fa fa-long-arrow-right"></i></a>
                </div>
            </div>
            <?php
                            endwhile;    wp_reset_postdata();
                        ?>


        </div>
    </div>
</section>