<?php
defined( 'ABSPATH' ) || exit( 'No Access!' );

global $options;

if (!$options->get_option('active-brand')) {
    return;
}

$b_args = array(
	'taxonomy'   => irk_get_brand_slug(),
	'hide_empty' => false,
	'number'     => $count,
	'meta_query' => array(
		array(
			'key'     => 'irk_is_special',
			'value'   => '1',
			'compare' => '=',
		),
	),
);
$terms = get_terms( $b_args );
if ( ! count( $terms ) ) {
	return null;
}

?>
<div class="slider-inner">
    <div class="owl-carousel">
		<?php foreach ( $terms as $term ): ?>
            <div class="term-<?php echo $term->term_id; ?> item">
                <a href="<?php echo get_term_link( $term->term_id ); ?>">
                    <div class="img-wrapper">
						<?php echo wp_get_attachment_image( get_term_meta( $term->term_id, 'irk_brand_image', true ), 'full', false, [ 'class' => 'img-fluid' ] ); ?>
                    </div>
					<?php if ( $show_name ): ?>
                        <span class="brand-name"><?php echo $term->name; ?></span>
					<?php endif; ?>
                </a>
            </div>
		<?php endforeach; ?>
    </div>
</div>