<?php
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly

?>
<div class="rivax-category-spot">
<?php
foreach ( $settings['category_items'] as $category_item ) {

    if(!$category_item['category'])
        continue;

    $category = get_category($category_item['category']);

    if(!$category)
        continue;
    ?>
    <div class="cat-item term-id-<?php echo intval($category->cat_ID); ?>">
        <?php
        if($category_item['icon']['value']) {
            echo '<span class="icon">';
            \Elementor\Icons_Manager::render_icon( $category_item['icon'] );
            echo '</span>';
        }
        ?>
        <div class="content">
            <?php if( $settings['browse_text'] ) {echo '<span class="browse">' . esc_html($settings['browse_text']) . '</span>';} ?>
            <h5 class="name">
                <span class="a"><?php echo esc_html($category->name); ?></span>
                <span class="b"><?php if($settings['show_count']) {echo intval($category->count) .  esc_html($settings['category_count_text']);} else {echo esc_html($category->name);} ?></span>
            </h5>
        </div>
        <a class="rivax-position-cover" <?php if( $settings['open_link_new_tab'] ) echo 'target="_blank"'; ?> href="<?php echo esc_url(get_category_link($category->cat_ID)); ?>" title="<?php echo esc_attr($category->name); ?>"></a>
    </div>
    <?php
}
?>
</div>
