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

20 lines
810 B
PHP
Raw Normal View History

2022-12-17 19:46:29 +01:00
<?php
if (has_category('chapters')) {
$romans = get_the_terms($post->ID, 'roman');
foreach( $romans as $roman ) {
2022-12-18 09:46:44 +01:00
echo "<a href= '" . esc_url( get_category_link( $roman->term_id ) ) . "' class='btn-small btn-primary'><i class='fa fa-book'></i> " . $roman->name . "</a>";
2022-12-17 19:46:29 +01:00
}
} else {
$categories = get_the_category();
foreach( $categories as $category ) {
2022-12-18 09:46:44 +01:00
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='btn-small btn-primary'><i class='fa fa-folder'></i> " . $category->cat_name . "</a>";
2022-12-17 19:46:29 +01:00
}
}
$tags = get_the_tags();
if ($tags) {
foreach( $tags as $tag ) {
2022-12-18 09:46:44 +01:00
echo "<a href= '" . esc_url( get_tag_link( $tag->term_id ) ) . "' class='btn-small btn-secondary'><i class='fa fa-tag'></i> " . $tag->name . "</a> ";
2022-12-17 19:46:29 +01:00
}
}
?>