        <?php
/**
 * Theme Name: EduCare
 * Theme URI: http://demo.com/educare
 * Author: demo.com
 * Author URI: http://demo.com
 * Description: Themes Is WordPress Theme Market
 * @package eschool
 */
 global $codedokan;
 ?>              
     <?php 
								$count_posts = wp_count_posts( 'teachers' )->publish;
								if ($count_posts == 0){
									get_template_part( 'template-parts/html/teacher' );
								}else{
								?>
								
                    <!--=======================
                        Teacher_section Start
                    ==========================--> 
        <section class="teacher_section">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12 col-md-12">
					<?php $teacher = $codedokan['our_teacher']; if($teacher){ ?>
                       <div class="teacher_title">
							<?php echo $teacher; ?>
                            <div class="icon_image">
                               <img src="<?php echo get_template_directory_uri(); ?>/assets/images/icon-image.png" alt="">
                            </div>
                       </div>
					<?php } ?>
                       
                        <div class="teacher_list owl-carousel">
                
                            <?php $cat_id = $codedokan['teachers_cat'];
					if($cat_id == 0) { ?>
					<?php
									$how_post = $codedokan['how_teacher'];
									$code_dokan = new WP_Query(array(
										'post_type' => 'teachers',
										'offset'     =>0,
										'posts_per_page' => $how_post,
										'order'     => 'ASC',
									));
									while($code_dokan->have_posts()) : $code_dokan->the_post(); ?>
									
							<div class="teacher_wrpp">
							<?php $teachers_image = get_post_meta(get_the_ID(),'teachers_image', true); if($teachers_image){ ?>
                                <div class="teacher_image">
                                     <img src="<?php echo $teachers_image; ?>" alt="">
                                </div>
								<?php } ?>
                                <div class="teacher_content">
                                    <h4 class="teacher_name">
										<a href="<?php the_permalink()?>"> <?php echo get_post_meta(get_the_ID(),'teachers_name', true); ?> </a>	
                                    </h4>
									
									<?php $teachers_designation = get_post_meta(get_the_ID(),'teachers_designation', true); if($teachers_designation){ ?>
                                    <h6 class="teacher_deg">
                                        <?php echo $teachers_designation; ?>
                                    </h6>
									<?php } ?>
	
                                </div>
                                
                                <div class="teacher-social">
                                    <?php $link = get_post_meta(get_the_ID(),'facebook_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>"><i class="lab la-facebook-f"></i></a>
										<?php } ?>
									<?php $link = get_post_meta(get_the_ID(),'twitter_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
                                    <i class="lab la-twitter"></i></a>
									<?php } ?>
										<?php $link = get_post_meta(get_the_ID(),'linkedin_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
										<i class="lab la-linkedin-in"></i></a>
										<?php } ?>
										<?php $link = get_post_meta(get_the_ID(),'web_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
                                    <i class="lab la-instagram"></i></a><?php } ?>
                                </div>
                                
                            </div>
							
							<?php endwhile;?>
					<?php }else{
					?>
					 <?php
								$term = get_term_by( 'id', $cat_id, 'teacherscat' );
                                $cat_name = $term->name;    
                                $cat_slug = $term->slug; 
								$how_post = $codedokan['how_teacher'];
								
							?>
							<?php   
									$args = array( 
										'post_type' => 'teachers',
										'posts_per_page' => $how_post,
										  'tax_query' => array(
											'relation' => 'OR',     
											array(
												'taxonomy' => 'teacherscat',
												'field'    => 'slug',
												'terms'    => $cat_slug,
											),
								
											) 
										); 
									$loop = new WP_Query( $args );
									while ( $loop->have_posts() ) : $loop->the_post(); ?>
                            
							
							
							<div class="teacher_wrpp">
							<?php $teachers_image = get_post_meta(get_the_ID(),'teachers_image', true); if($teachers_image){ ?>
                                <div class="teacher_image">
                                     <img src="<?php echo $teachers_image; ?>" alt="">
                                </div>
								<?php } ?>
                                <div class="teacher_content">
                                    <h4 class="teacher_name">
										<a href="<?php the_permalink()?>"> <?php echo get_post_meta(get_the_ID(),'teachers_name', true); ?> </a>	
                                    </h4>
									
									<?php $teachers_designation = get_post_meta(get_the_ID(),'teachers_designation', true); if($teachers_designation){ ?>
                                    <h6 class="teacher_deg">
                                        <?php echo $teachers_designation; ?>
                                    </h6>
									<?php } ?>
	
                                </div>
                                
                                <div class="teacher-social">
                                    <?php $link = get_post_meta(get_the_ID(),'facebook_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>"><i class="lab la-facebook-f"></i></a>
										<?php } ?>
									<?php $link = get_post_meta(get_the_ID(),'twitter_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
                                    <i class="lab la-twitter"></i></a>
									<?php } ?>
										<?php $link = get_post_meta(get_the_ID(),'linkedin_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
										<i class="lab la-linkedin-in"></i></a>
										<?php } ?>
										<?php $link = get_post_meta(get_the_ID(),'web_url', true); if($link){ ?>
                                        <a href="<?php echo $link; ?>">
                                    <i class="lab la-instagram"></i></a><?php } ?>
                                </div>
                                
                            </div>
							
							
							 <?php endwhile; wp_reset_query(); ?> 
					<?php } ?>
                            
                                                    
                                                  
                            
                        </div>
                    </div>
                </div>
            </div>
        </section>
                                       
                    <!--=======================
                        Teacher_section End
                    ==========================--> 
					 <?php } ?> 