WordPressでCustom Post Type UIプラグインを使用してカスタム投稿できるようにしました。
タクソノミーをカテゴリー用、タグ用と二つ作成して使用しています。
カテゴリーページにて現カテゴリーに属する記事のタグ一覧を載せたいのですが、上手くいかず表記は出るものの、一つしかタグが出ません。
分かる方すみませんがご教授お願いいたします。
<?php // 投稿に紐付いてるタームのリンク付き一覧を表示 $custom_post_tag = 'custom_tag'; // タクソノミーのスラッグを指定 $custom_post_tag_terms = wp_get_object_terms($post->ID, $custom_post_tag); if(!empty($custom_post_tag_terms)){ if(!is_wp_error( $custom_post_tag_terms )){ foreach($custom_post_tag_terms as $term){ $tag_term_link = get_term_link($term->slug, $custom_post_tag); $tag_term_name = $term->name; echo '<li><a href="'.$tag_term_link.'">'.$tag_term_name.'</a></li>'; } } } ?>