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/article/terms.php
2022-12-18 14:39:50 +01:00

19 lines
813 B
PHP

<?php
if (has_category('chapters')) {
$romans = get_the_terms($post->ID, 'roman');
foreach( $romans as $roman ) {
echo "<a href= '" . esc_url( get_category_link( $roman->term_id ) ) . "' class='badge btn-primary'><i class='fa fa-book'></i>&nbsp;" . $roman->name . "</a>";
}
} else {
$categories = get_the_category();
foreach( $categories as $category ) {
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='badge btn-primary'><i class='fa fa-folder'></i>&nbsp;" . $category->cat_name . "</a>";
}
}
$tags = get_the_tags();
if ($tags) {
foreach( $tags as $tag ) {
echo "<a href= '" . esc_url( get_tag_link( $tag->term_id ) ) . "' class='badge btn-secondary'><i class='fa fa-tag'></i>&nbsp;" . $tag->name . "</a> ";
}
}
?>