<?php
global $wp_query;
$term = $wp_query->get_queried_object();
$ids = get_term_meta($term->term_id, 'gallery_ids', true);
$k = $key % 8;
if(empty($ids)) return;
if(!isset($ids[$k])) return;
$count_filter = get_query_var('count_filter', 0);
if($count_filter > 0) return;
$thumnail_id = $ids[$k];
?>

<div class="col-lg-12 col-12">
    <div class="gallery_category">
        <img src="<?php echo wp_get_attachment_image_url($thumnail_id , 'full'); ?>" alt="">
    </div>

</div>
