single: add categories and tags
This commit is contained in:
parent
9b79d926c8
commit
754f60e8bc
1 changed files with 17 additions and 0 deletions
17
single.php
17
single.php
|
@ -12,6 +12,23 @@
|
|||
<aside class="article-excerpt">
|
||||
<?php the_excerpt(); ?>
|
||||
|
||||
<section class="article-taxonomies">
|
||||
<div class="article-categories article-taxonomies-container">
|
||||
<?php $categories = get_the_category();
|
||||
foreach( $categories as $category ) {
|
||||
echo "<a href= '" . esc_url( get_category_link( $category->term_id ) ) . "' class='badge badge-category'>" . $category->cat_name . "</a>";
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
<div class="article-tags article-taxonomies-container">
|
||||
<?php $tags = get_the_tags();
|
||||
if ($tags) {
|
||||
foreach( $tags as $tag ) {
|
||||
echo "<a href= '" . esc_url( get_tag_link( $tag->term_id ) ) . "' class='badge badge-tag'>" . $tag->name . "</a>";
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
</section>
|
||||
<hr />
|
||||
</aside>
|
||||
|
||||
|
|
Reference in a new issue