<?php
/**
Taxonomy template
 */
get_header();

$gamme = get_queried_object();
//$taxonomy = $queried_object->taxonomy;
$term_id = $gamme->term_id;
$term = get_term_by( 'id', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
//echo term_description( $term, $taxonomy );
$gamme_img = get_field('gamme_img', $gamme);
?>
<div class="container-fluid header2">
    <div class="row">
        <div class="col-12 col-lg-6 header2_left">
                <div class="header2_img">
                    <img src="<?php echo $gamme_img['sizes']['large'];?>" alt="<?php echo $gamme->name;?>" class="img-fluid">
                </div>
        </div>
        <div class="col-12 col-lg-6 bg-dblue d-flex align-items-center header2_right">
            <div class="col-lg-7 offset-lg-3">
                <?php
                if ( function_exists('yoast_breadcrumb') ) {
                    yoast_breadcrumb( '<p class="breadcrumbs white">','</p>' );
                }
                ?>
                <h1 class="h1 white"><?php echo $gamme->name;?></h1>
                <div class="white term_description">
                <?php echo term_description($term_id); ?>
                <?php
                if(get_field('gamme_doc', $gamme)){
                    $gamme_doc = get_field('gamme_doc', $gamme);
                    echo '<a target="" href="" class="btn btn-link white"><span>'.__('Download documentation', 'wpbootstrap').' <i
                                class="icon icon-arrow-right"></i></span></a>';
                }
                ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid container-fluid-lg gamme_pdts py-5">
    <div class="row">
        <div class="col-12 py-5">
            <h2><?php _e('Our products','wpbootstrap');?></h2>
        </div>
    </div>
    <div class="row">
        <?php if(have_posts()) :
            while(have_posts()) :
                the_post();
                $thumb_id = get_post_thumbnail_id();
                $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail', true);
        ?>
            <div class="col-6 col-lg-3 p-3">
                <a href="<?php echo get_permalink();?>" class="d-block text-center pdt_bloc transition">
                    <img src="<?php echo $thumb_url[0];?>" alt="<?php echo get_the_title();?>" class="img-fluid">
                    <h2 class="black h3 underline"><?php echo get_the_title();?></h2>
                </a>
            </div>
                


            <?php endwhile;
        endif;?>        
    </div>
</div>


<?php get_footer(); ?>
