<?php
    $tax = get_theme_mod('crt_manage_latest_category_one_list');
    $attr_class = '';
    if($args['layout'] == 'masonry2') {
        $attr_class = 'two';
    } elseif($args['layout'] == 'masonry3') {
        $attr_class = 'three';
    } elseif($args['layout'] == 'masonry4'){
        $attr_class = 'four';
    }
?>
<div class="grid__item grid__item-<?php echo esc_attr($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>
