
カスタム投稿の選択したカテゴリ(ターム)を記事に出力する
<ul class="tag_list">
<?php
$terms = get_the_terms($post->ID,'cat_sample');
// $terms = get_terms('cat_sample');
foreach ( $terms as $term ) {
echo '<li><a href="'.get_term_link($term).'">'.$term->name.'</a></li>';
}
?>
</ul>
参考:タームの取得と表示方法
https://hirashimatakumi.com/blog/164.html