Add series tags rendering to single post
This commit is contained in:
11
single.php
11
single.php
@@ -57,7 +57,16 @@ get_header(); ?>
|
|||||||
|
|
||||||
<footer class="entry-footer mt-5 pt-4 border-top mx-auto px-3" style="max-width: 680px;">
|
<footer class="entry-footer mt-5 pt-4 border-top mx-auto px-3" style="max-width: 680px;">
|
||||||
<div class="entry-tags d-flex flex-wrap gap-2">
|
<div class="entry-tags d-flex flex-wrap gap-2">
|
||||||
<?php the_tags('<span class="badge bg-light text-dark text-decoration-none fw-normal p-2">', '</span><span class="badge bg-light text-dark text-decoration-none fw-normal p-2">', '</span>'); ?>
|
<?php
|
||||||
|
the_tags('<span class="badge bg-light text-dark text-decoration-none fw-normal p-2">', '</span><span class="badge bg-light text-dark text-decoration-none fw-normal p-2">', '</span>');
|
||||||
|
|
||||||
|
$series_terms = get_the_terms(get_the_ID(), 'series');
|
||||||
|
if ($series_terms && !is_wp_error($series_terms)) {
|
||||||
|
foreach ($series_terms as $term) {
|
||||||
|
echo '<a href="' . esc_url(get_term_link($term)) . '" class="badge bg-secondary text-white text-decoration-none fw-bold p-2"><i class="bi bi-collection"></i> ' . esc_html($term->name) . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</footer><!-- .entry-footer -->
|
</footer><!-- .entry-footer -->
|
||||||
</article><!-- #post-<?php the_ID(); ?> -->
|
</article><!-- #post-<?php the_ID(); ?> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user