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
802 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='btn-small btn-info'><i class='fa fa-book'></i> " . $roman->name . "</a>";
}
} else {
$categories = get_the_category();
foreach( $categories as $category ) {
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='btn-small btn-info'><i class='fa fa-folder'></i> " . $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='btn-small btn-primary'><i class='fa fa-tag'></i> " . $tag->name . "</a> ";
}
}
?>