<?php get_header(); ?>
<div id="full-content" class="">
    <section style="background: url('<?php echo home_url(); ?>/wp-content/uploads/2018/11/media-coverage-banner-bg.jpg')no-repeat center/cover;"  class="media-banner-bg">  
        <div class="container">
        <h2 class="page-title-cus">Our Team</h2>
        </div>
    </section>
    <div class="container posRelative">   
        <div class="row blog-details">
            <div class="col-lg-12 col-md-12 our-team-detail">
                <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
                <div class="row">
                    <div class="col-md-4">
                        <!--<img class="our-team-image" src="<?php //echo get_field('our_team_detail_view_image'); ?>" />-->
                        <figure class="profile_img"><?php the_post_thumbnail('large'); ?></figure>
                    </div>
                    <div class="col-md-8">
                        <div class="our-team-title">
                            <h1 class="our-team-title-h2"><?php the_title(); ?></h1>
                            <h5><?php the_field('designation'); ?>   </h5>
                            
                        </div>                    
                       <div class="profile_content">
                        <?php the_content(); ?>
                       </div>

                      
                      
                       <div class="row">
                        <div class="col-12 col-sm-5">
                                <!-- <div class="contact-button">
                                    <a href="javascript:void(0);" class="btn btn-primary-outline">Contact <?php //the_title(); ?></a>
                                </div> -->
                        </div>
                        <div class="col-12 col-sm-7 text-right profile-social-icons">
                                <div class="social">
                                    <?php if (get_field('facebook_profile_page')) { ?>
                                        <a href="<?php echo get_field('facebook_profile_page'); ?>" class="facebook"></a>
                                    <?php }?>
                                     <?php if (get_field('twitter_profile_page')) { ?>
                                        <a href="<?php echo get_field('twitter_profile_page'); ?>" class="twitter"></a>
                                    <?php }?>
                                     <?php if (get_field('linkedin_profile_page')) { ?>
                                        <a href="<?php echo get_field('linkedin_profile_page'); ?>" class="linkedin"></a>
                                    <?php }?>
                                   
                                </div>
                        </div>
                       </div>
                        
                    </div>
                </div>

               
                
                  
                <?php endwhile; ?> 
                <?php endif; ?>


            </div>
        </div>
         <?php
                $author_name = get_the_title();
                $author_type;
                $formID;
                if($author_name==='Saurabh Mukherjea, CFA'){
                    $author_type = 'blogs';
                    $formID = '1709';
                } elseif($author_name==='Pramod Gubbi, CFA'){
                    $author_type = 'story';
                    $formID = '1710';
                } elseif($author_name==='Rakshit Ranjan, CFA'){
                    $author_type = 'Newsletter';
                    $formID = '1709';
                } else {
                        $author_type = '';
                }
                global $post;
                $user_posts = get_posts( array(
                    'post_type' => $author_type,
                    'orderby'       =>  'post_date',
                    'order'         =>  'DESC',
                    'numberposts' => 5
                ) );
            ?>
            <?php
                if( !empty($author_type)){
             ?>
          <div class="row author-activity">
            <div class="col-12">
                <h5 class="section_title">Recent posts by <?php the_title(); ?></h5>
            </div>
            <div class="col-12 p0">
                   <div class="owl-carousel owl-theme post-slider">

                        <?php 
                            foreach ( $user_posts as $post ) {
                         ?>

                        <div class="post-slider-item blog-item-info">
                            <figure class="post-img">
                                <?php if ( has_post_thumbnail() ) {?>
                                <?php the_post_thumbnail( $post->ID); ?>
                                <?php } else { ?>
                                <img src="<?php echo get_template_directory_uri() ?>/images/featured_default_image.jpg" alt="<?php echo $post->post_title ?>" />
                                <?php } ?>
                            </figure>
                            <div class="post-slider-content">
                            <p class="publish-date"><?php echo  date( 'd M, Y', strtotime($post->post_date ) ); ?></p>
								<h2 class="blog-title-h2"><a href="<?php the_permalink($post->ID) ; ?>"><?php echo pov_excerpt( $post->post_title,50); ?></a></h2>
                           
                            <!-- <p class="content">
                                <?php echo pov_excerpt( $post->post_excerpt, '100'); ?>
                            </p> -->
                            <p class="link"><a href="<?php the_permalink($post->ID) ; ?>" class="view-detail">Read</a></p>
                            </div>
                        </div>
                      <?php } 
                    ?>
            </div>
        </div>
        </div>
                <?php } ?>  
        <!-- other members-->
        <!--contact form-->
        <!-- <div class="row ">
            <div class="col-12">
                <div class="contact-person-form">
                    <h5 class="form_title">Contact <?php //echo $author_name; ?></h5>
                    <?php //echo do_shortcode('[contact-form-7 id="'.$formID.'" title="Contact to Saurabh Mukherjea"]'); ?>
                </div>
            </div>
        </div> -->
        <!--contact form end-->
        <div class="row team-member-outer">
                
                <div class="col-12 p0" >
                    <div class="owl-carousel owl-theme team-member-carousel">
                        <?php
                            $the_query = new WP_Query( array(
                            'post_type'=>'Team',
                            'order'=> 'ASC',
                            'paged' => get_query_var('paged') ? get_query_var('paged') : 1) 
                            ); 
                                while ($the_query -> have_posts()) : $the_query -> the_post(); 
                        ?>
                        
                            <div class="team-member-item">
                                <figure>
                                    <?php the_post_thumbnail(); ?>
                                   <!-- <img src="<?php //echo get_field('our_team_detail_view_image'); ?>" /-->
                                   </figure>
                                <div class="content">
									<h3 class="our-team-title-h2"><a href="<?php echo get_permalink( $post->ID ); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                                    <p class="designation"><?php the_field('designation'); ?>   </p>
                                    <p class="link"><a href="<?php echo get_permalink( $post->ID ); ?>" class="view-detail">View Profile</a></p>
                                </div>
                            </div>
                        
                        <?php endwhile; ?> 
                    </div>
				    </div>
                </div>

        <!--end other members-->
    </div>
</div>

<?php get_footer(); ?>
