This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
qdouze2-wordpress-theme/components/sidebar/categories.php

19 lines
721 B
PHP
Raw Permalink Normal View History

2023-11-20 10:05:50 +01:00
<section class="card c-secondary d-flex-sm d-none">
2023-11-20 13:04:09 +01:00
<h2 class="card-header"><svg class="icon icon-folder" alt=""><use xlink:href="#icon-folder"></use></svg> Catégories</h2>
2022-12-17 22:34:02 +01:00
<div class="menu fg-dark">
<ul>
<?php
$categories = get_categories( array(
'orderby' => 'name',
'order' => 'ASC'
) );
2022-12-17 19:46:29 +01:00
2022-12-17 22:34:02 +01:00
foreach( $categories as $category ) {
if ($category->slug != "blog" && $category->slug != "chapters") {
2022-12-18 09:46:44 +01:00
echo '<li><a class="menu-element" href="' . get_category_link($category->term_id) . '">' . $category->name . '<span class="badge bg-primary m0">'. $category->count . '</span></a></li>';
2022-12-17 22:34:02 +01:00
}
}?>
</ul>
</div>
</section>