<?php
/*
* Template Name:Team Detail Page
*/
?>
<?php get_header(); ?>
<?php $template_url = get_bloginfo ( 'template_url' ) . '/'; ?>
<?php 
   //to check if there is a post regarding the url access the page
   if (have_posts ()) :
     the_post(); 
   endif;
   $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'thumbnail' );
   if($url != "")
   {
   $img = $url; 
   }else{
   $img = $template_url."img/acupuncturebg.jpg";
   }
?>
<?php 
$postID = get_queried_object_id();
$parent_id = $post->post_parent;
$parent_post = get_post($parent_id);
$parent_post_title = $parent_post->post_title;
?>
<!-- breadcumb -->
  <section class="z-index-common breadcumb-wrapper" style="background-image: url(<?php echo $img;?>); background-size: 100%;">
    <div class="container">
      <div class="row justify-content-between align-items-center">
        <div class="col-auto">
          <div class="breadcumb-content">
            <h1 class="breadcumb-title"><?php if(get_field('bradcamp_title') != ""){ echo get_field('bradcamp_title');}else{ the_title();}?></h1>
            <div class="breadcumb-menu-wrap">
              <ul class="breadcumb-menu">
      
                <li><?php if(get_field('bradcamp_title') != ""){ echo get_field('bradcamp_title');}else{ the_title();}?></li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section id="team_details_page" class="py-5">
   <div class="container">
      <div class="sec-title">
         <h2 class="text-white">Our Members Details</h2>
         <p class="text-white"><?php the_field('page_content'); ?></p>
      </div>
      <div class="row align-items-center">
         <div class="col-lg-5">
            <figure class="member_fig overflow-hidden">
               <img src="<?php the_field('front_image'); ?>">
            </figure>
         </div>

          <div class="col-lg-7">
            <div class="member__details d-flex flex-column h-100">
              <?php the_content(); ?>
               <?php the_field('button'); ?>
				
            </div>
         </div>
      </div>
      
   </div>
</section>

  <section class="team_slider_home py-5">
	<div class="container">
		<div class="section-title mb-5 wow fadeInUp" data-wow-delay="0.1s" style="visibility: visible; animation-delay: 0.1s; animation-name: fadeInUp;">
			<h1 class="display-3 mb-4">Other Specialist</h1>
         </div>
         
                  <div class="team_slider owl-carousel">
                <?php
                $args = array(
                            'post_type'      => 'page',
                            'posts_per_page' => -1,
                            'post_parent'    => $parent_id,
                            'order'          => 'DESC',
                            'orderby'        => 'menu_order'
                         );
                $query = new WP_Query($args);
                

                $post_count = $query->post_count;
                if ( $query->have_posts() ){
                $i = 1;
                  while ( $query->have_posts() ){
                    $query->the_post();
                    $img_url = get_the_post_thumbnail_url( get_the_ID(),'full');
                    $post = get_post(get_the_ID());
                ?>
                    <a href="<?php the_permalink();?>" class="py-4 d-block">
                            <div class="team_card">
                                <figure class="team_pic m-0">
                                  <?php
                                              $front_image = get_field('front_image'); 
                                                                      if($front_image) {?>
                                                                          
                                                                          <img src="<?php echo $front_image;?>" alt="Service">
                                                                          
                                                                      <?php }
                                                                    
                                          ?> 
                                  
                                </figure>
                                <div class="member_details">
                                  <h5 class="text-center"><?php the_title(); ?></h5>
                                  <p class="text-center"><?php the_field('designation');?></p>
                                </div>
                            </div>
                          </a>
                <?php
                   $i++;
                   }
                }
                ?>            
                          
                  </div>
                
	</div>
</section>



  <!-- Blog Area -->

  <!-- Blog Area End -->
  
<?php get_footer(); ?>