I want to display all the existing categories in my Wordpress page in the bottom of the content and the selected category will be in bold style, as follows:
For example, for an existing post if I selected category2 of 3 existing, then it show like this
category1 category2 category3
<div class="entry-meta">
<span class="term-links">
<?php foreach ( get_the_terms( $post->ID, 'category') as $term ) :
?>
<a href="<?php echo esc_url( get_term_link( $term->term_id ) )
?>"><span class="<?php echo $term->slug ?>"><?php echo $term->name ?>
</span></a>
<?php endforeach; ?>
</span>
<style>
.term-links .category2 {
display: inline-block;
font-weight:bold;
</style>
In the above code only display the selected category, not showing the all category. How can I do this?