<?php /* Template Name: Leadership Page */ ?>
<?php get_header(); ?>

<!-- Start Breadcrumb 
    ============================================= -->
    <div class="breadcrumb-area text-center shadow dark bg-fixed text-light" style="background-image: url(<?php echo get_field('web_banner'); ?>);">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 offset-lg-2">
                    <h1><?php echo get_field('banner_title'); ?></h1>
                    <ul class="breadcrumb">
                        <li><a href="<?php echo site_url() ?>"><i class="fas fa-home"></i> Home</a></li>
                        <li class="active">Leadership</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- End Breadcrumb -->


    <div class="team-area default-padding bottom-less">
        <div class="container">
            <div class="team-items text-center">
                <div class="row">
                    <!-- Single Item -->
                    <?php if( have_rows('section_description') ): ?>
                        <?php while ( have_rows('section_description') ) : the_row(); ?>
                        <?php if( get_row_layout() == 'section_description_01' ): ?>

                        <div class="leadership-title">
                            <h1><?php echo get_sub_field('section_title'); ?></h1>
                            <p><?php echo get_sub_field('section_sub_title'); ?></p>
                        </div>
                           <?php endif; ?>
                        <?php endwhile; ?>
                    <?php endif; ?>
                    <?php
                    // Query to get posts
                    $args = array(
                        'post_type' => 'team', // Change this to your custom post type if needed
                        'posts_per_page' => -1, // Number of posts to display
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'team-category', // Taxonomy name
                                'field' => 'slug', // Field to match the term ('slug' or 'term_id')
                                'terms' => 'leadership', // Term slug to filter by
                            ),
                        ),
                    );

                    $query = new WP_Query($args); 
                    ?>

                    <?php if ( $query->have_posts() ) : ?>
                        <?php while ( $query->have_posts() ) : $query->the_post(); ?>
                    <div class="single-item col-lg-4 col-md-6">
                        <div class="item">
                            <div class="thumb">
                                <img src="<?php the_post_thumbnail_url(); ?>" alt="Thumb">
                                <ul>
                                    <li class="facebook">
                                        <a href="#">
                                            <i class="fab fa-facebook-f"></i>
                                        </a>
                                    </li>
                                    <li class="twitter">
                                        <a href="#">
                                            <i class="fab fa-twitter"></i>
                                        </a>
                                    </li>
                                    <li class="pinterest">
                                        <a href="#">
                                            <i class="fab fa-pinterest"></i>
                                        </a>
                                    </li>
                                    <li class="linkedin">
                                        <a href="#">
                                            <i class="fab fa-linkedin-in"></i>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div class="info">
                                <h4><?php the_title(); ?></h4>
                                <?php the_content() ?>
                            </div>
                        </div>
                    </div>
                    <!-- End Single Item -->
                    <?php endwhile; ?>
                    <?php else : ?>
                        <p>No posts found.</p>
                    <?php endif; ?>

                    <?php wp_reset_postdata(); ?>

                    
                </div>
            </div>
        </div>
    </div>
    <!-- End Team Area -->

    <div class="team-area default-padding bottom-less">
        <div class="container">
            <div class="team-items text-center">
                <div class="row">
                    <!-- Single Item -->
                    <?php if( have_rows('section_description') ): ?>
                    <?php while ( have_rows('section_description') ) : the_row(); ?>
                    <?php if( get_row_layout() == 'section_description_03' ): ?>

                    <div class="leadership-title">
                        <h1><?php echo get_sub_field('section_title'); ?></h1>
                        <p><?php echo get_sub_field('section_sub_title'); ?></p>
                    </div>
                    <?php endif; ?>
                    <?php endwhile; ?>
                <?php endif; ?>

                <?php
                    // Query to get posts
                    $args = array(
                        'post_type' => 'team', // Change this to your custom post type if needed
                        'posts_per_page' => -1, // Number of posts to display
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'team-category', // Taxonomy name
                                'field' => 'slug', // Field to match the term ('slug' or 'term_id')
                                'terms' => 'management', // Term slug to filter by
                            ),
                        ),
                    );

                    $query = new WP_Query($args); 
                    ?>

                    <?php if ( $query->have_posts() ) : ?>
                        <?php while ( $query->have_posts() ) : $query->the_post(); ?>
                    <div class="single-item col-lg-4 col-md-6">
                        <div class="item">
                            <div class="thumb">
                                <img src="<?php the_post_thumbnail_url(); ?>" alt="Thumb">
                                <ul>
                                    <li class="facebook">
                                        <a href="#">
                                            <i class="fab fa-facebook-f"></i>
                                        </a>
                                    </li>
                                    <li class="twitter">
                                        <a href="#">
                                            <i class="fab fa-twitter"></i>
                                        </a>
                                    </li>
                                    <li class="pinterest">
                                        <a href="#">
                                            <i class="fab fa-pinterest"></i>
                                        </a>
                                    </li>
                                    <li class="linkedin">
                                        <a href="#">
                                            <i class="fab fa-linkedin-in"></i>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div class="info">
                                <span><?php echo get_field('designation') ?></span>
                                <h4><?php the_title(); ?></h4>
                                <?php the_content() ?>
                            </div>
                        </div>
                    </div>
                    <!-- End Single Item -->
                    <?php endwhile; ?>
                    <?php else : ?>
                        <p>No posts found.</p>
                    <?php endif; ?>

                    <?php wp_reset_postdata(); ?>
                   
                    
                </div>
            </div>
        </div>
    </div>
    <!-- End Team Area -->

<?php get_footer(); ?>