<?php get_header();
$image_types = get_terms([
    'taxonomy' => 'gallery-types',
    'hide_empty' => true,
    'parent'   => 0
]);
?>


<article id="post-gallery" class="gallery page panel panel-tall panel-full">


	<div class="panel-content panel-content-100">

		<header class="entry-header">
<div class='container'>


			<h1 class="entry-title">Gallery</h1>

            <div class="entry-navigation control-group-filters archive-filters">
                <?php if($image_types) { ?>
                    <div class="control-facetwp-tabs">
                        
                        <div class="" data-name="gallery-types" data-type="radio">
                            <?php foreach($image_types as  $image_type) { ?>
                                <a href="<?=get_term_link($image_type);?>" class=" filter btn btn-outline-gray" ><?=$image_type->name;?></a>
                            <?php } ?>
                        </div>
                    </div>
                <?php } ?>
            </div>
        </div>

		</header><!-- .entry-header -->
<section class="page-section archive-content">

    <div class="section-inner">

        <div class="container">



		<div class="entry-content">

            <div class="galleries galleries-cards" >
                <?php foreach($image_types as  $image_type) { ?>
                    <figure>
                      <a href="<?=get_term_link($image_type);?>" >
											<?php 
											$image_id = get_field('image', $image_type->taxonomy . '_' . $image_type->term_id);
											if($image_id)	{
												echo wp_get_attachment_image($image_id, 'card-double');
											} ?>
                        <h4><?=$image_type->name;?></h4>
                      </a>
                    </figure>
                <?php } ?>
            </div>

			
		</div><!-- .entry-content -->
    </div>
</div>
</section>

	</div><!-- .panel-content -->

</article><!-- #post-## -->



<?php get_footer(); ?>