<?php

/**
 * Theme Name: ESchool
 * Theme URI: http://demo.com/eschool
 * Author: demo.com
 * Author URI: http://demo.com
 * Description: Themes Is WordPress Theme Market
 * @package eschool
 */
get_header();
global $codedokan;
?> 



<?php				
						$obj = get_queried_object();
						$categroy_name = $obj->name;
						?>
                            
        
            <!--================================
                    Archive-Page-Start
            ===============================-->

            <div class="archive-page">
                <div class="container">
				
				 <div class="row">              
                    <div class="col-lg-12 col-md-12">
                        <div class="video-p-title">
                             <?php echo $categroy_name;?> 
                            <div class="icon-class">
                                <img src="<?php echo get_template_directory_uri(); ?>/assets/images/icon-image.png" alt="">
                            </div>
                        
                        </div>
                    </div>
                </div>
				
				
                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                    <tr>
								  <th scope="col"><?php echo $codedokan['teacher_serial'];?></th>
                                   <th scope="col"><?php echo $codedokan['teacher_name'];?></th>
                                  <th scope="col"><?php echo $codedokan['teacher_designation'];?> </th>
                                  <th scope="col"><?php echo $codedokan['teacher_number'];?></th>
                                   <th scope="col"><?php echo $codedokan['teacher_image'];?></th>
                                   <th scope="col"><?php echo $codedokan['teacher_details'];?></th>
                                 </tr>
                                </thead>
                                <tbody>
                                    
									<?php
								$term = get_queried_object();
                                $cat_name = $term->name;    
                                $cat_slug = $term->slug; 								
							?>
							<?php   
									$args = array( 
										'post_type' => 'teachers',
										'posts_per_page' => 1000,
										'order' => 'ASC',
										  '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(); ?>

                                 
								
								 
								 <tr>
								 <th class="wrpper" scope="row" width="5%"><?php echo get_post_meta(get_the_ID(),'sl_number', true); ?></th>
								 
                                   <td  class="wrpper" scope="row" width="25%"><?php echo get_post_meta(get_the_ID(),'teachers_name', true); ?></td>
         
                                     <td class="wrpper" width="10%"> <?php echo get_post_meta(get_the_ID(),'teachers_designation', true); ?> </td>
                                     <td class="wrpper" width="10%"><?php echo get_post_meta(get_the_ID(),'mobile_number', true); ?> </td>
                                     <td class="wrpper" width="15%">
									 <?php $image = get_post_meta(get_the_ID(),'teachers_image', true); if($image){ ?>
                                         <div class="image">
                                            <img src="<?php echo $image;?>">
                                         </div>
									<?php } ?>
                                     </td>
                                     <td class="wrpper archive-btn" width="10%">
                                        <a href="<?php the_permalink()?>"> <?php echo $codedokan['teacher_details'];?> <span> <i class="las la-arrow-right"></i></span> 
                                    </td>
                                 </tr>
								 
								 
								  <?php endwhile; ?>   
								  




                                </tbody>
                            </table>
                    </div>

                    
      


                </div>
            </div>


    
<?php
get_footer();
?>    