29 lines
1.4 KiB
PHP
29 lines
1.4 KiB
PHP
<h3 class="sr-only">Tags et catégories</h3>
|
|
<?php
|
|
if (has_category('chapters')) {
|
|
echo "<ul class='nolist' aria-labelledby='title-article-taxo-romans'>";
|
|
echo '<h4 class="sr-only" id="title-article-taxo-romans">Romans</h4>';
|
|
$romans = get_the_terms($post->ID, 'roman');
|
|
foreach( $romans as $roman ) {
|
|
echo "<li><a href= '" . esc_url( get_category_link( $roman->term_id ) ) . "' class='badge c-primary'><i class='icon-book'></i> " . $roman->name . "</a></li>";
|
|
}
|
|
echo "</ul>";
|
|
} else {
|
|
$categories = get_the_category();
|
|
echo "<ul class='nolist' aria-labelledby='title-article-taxo-categories'>";
|
|
echo '<h4 class="sr-only" id="title-article-taxo-categories">Catégories</h4>';
|
|
foreach( $categories as $category ) {
|
|
echo "<li><a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='badge c-primary'><i class='icon-folder'></i> " . $category->cat_name . "</a></li>";
|
|
}
|
|
echo "</ul>";
|
|
}
|
|
$tags = get_the_tags();
|
|
if ($tags) {
|
|
echo "<ul class='nolist' aria-labelledby='title-article-taxo-tags'>";
|
|
echo '<h4 class="sr-only" id="title-article-taxo-tags">Tags</h4>';
|
|
foreach( $tags as $tag ) {
|
|
echo "<li><a href= '" . esc_url( get_tag_link( $tag->term_id ) ) . "' class='badge c-secondary'><i class='icon-tag'></i> " . $tag->name . "</a></li>";
|
|
}
|
|
echo "</ul>";
|
|
}
|
|
?>
|