<?php
/**
 * Category filters template
 *
 * @package Multi
 */

?>

<?php
$multimagazine_options = array(
	'hierarchical' => false,
	'parent'       => 0,
);
$multimagazine_cats    = get_terms( 'category', $multimagazine_options );
if ( count( $multimagazine_cats ) ) :
	?>
<div class="filters">
	<ul class="filter-list">
		<?php
		$multimagazine_base_link = get_permalink( get_option( 'page_for_posts' ) );
		if ( empty( $multimagazine_base_link ) ) {
			$multimagazine_base_link = home_url( '/' );
		}
		?>
		<li><a href="<?php echo esc_url( $multimagazine_base_link ); ?>" class="selected"><?php esc_html_e( 'All', 'multimagazine' ); ?></a></li>
		<?php foreach ( $multimagazine_cats as $multimagazine_cat ) : ?>
		<li><a href="<?php echo esc_url( get_category_link( $multimagazine_cat->term_id ) ); ?>"><?php echo esc_html( $multimagazine_cat->name ); ?></a></li>
		<?php endforeach; ?>
	</ul>
</div>
	<?php
endif;
