<?php
/**
 * Taxonomy Widget Content View file.
 *
 * @package    CodexShaper_Framework
 * @author     CodexShaper <info@codexshaper.com>
 * @license    https://www.gnu.org/licenses/gpl-2.0.html
 * @link       https://codexshaper.com
 * @since      1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
?>
<div class="cdx-widget cdx-widget-category">
	<?php if ( $title_html && $title ) : ?>
		<?php echo wp_kses_post( $title_html ); ?>
	<?php endif; ?>
	<?php if ( ! empty( $limited_terms ) ) : ?>
		<ul class="cdx-categories-wrap">
			<?php foreach ( $limited_terms as $item ) : ?>
				<li class="cdx-category-list">
					<a class="cdx-category-link" href="<?php echo esc_url( get_term_link( $item ) ); ?>" aria-label="Post taxonomy link">
						<span class="csmf--title"><?php echo esc_html( $item->name ); ?></span>
						<?php if ( 'yes' === $post_counter ) : ?>
							<span class="csmf--post-counter"><?php echo esc_html( $settings['post_counter_prefix'] ); ?><?php echo esc_html( $item->count ); ?> <?php echo esc_html( $settings['post_counter_postfix'] ); ?></span>
						<?php endif; ?>
						<?php echo wp_kses( $taxonomy_icon, csmf_get_svg_rules() ); ?>
					</a>
				</li>
			<?php endforeach ?>
		</ul>
	<?php endif; ?>
</div>
