<?php
    $tax = get_theme_mod('crt_manage_latest_category_one_list');
    $crt_builder_with_elementor_attr_class = '';
    if($crt_builder_with_elementor_args['layout'] == 'masonry2') {
        $crt_builder_with_elementor_attr_class = 'two';
    } elseif($crt_builder_with_elementor_args['layout'] == 'masonry3') {
        $crt_builder_with_elementor_attr_class = 'three';
    } elseif($crt_builder_with_elementor_args['layout'] == 'masonry4'){
        $crt_builder_with_elementor_attr_class = 'four';
    }
?>
<div class="grid__item grid__item-<?php echo esc_attr($crt_builder_with_elementor_attr_class); ?> mb-4 post_standard">
    <div class="grid__category--inner">
        <?php if(!empty($tax)): ?>
            <?php foreach ( $tax as $tax_id ) :
                $term = get_term($tax_id);
                $count = $term->count;
                $name = $term->name;
                $term_link = get_term_link($term);
                ?>
                <div class="tax__item">
                    <h3 class="tax__name"><a href="<?php echo esc_url($term_link); ?>"><?php echo esc_html($name); ?></a></h3>
                </div>
            <?php endforeach;  ?>
        <?php endif; ?>
    </div>
</div>
