<?php
$cat_id =91;
$current_posts = get_objects_in_term( $cat_id, ‘category’ ); // 表示中のカテゴリーに属する投稿のIDを配列で取得
$current_tags = wp_get_object_terms( $current_posts, ‘post_tag’ ); // 表示中のカテゴリーに属する投稿に付けられたタグの情報をまとめて取得
if ( $current_tags ) {
echo ‘<div class=”ol-circle li-accentbdr acc-bc-before”>’;
echo ‘<ol>’ . “\n”;
foreach ( $current_tags as $tag ) {
if ( $tag->count==1 ) {
echo ‘<li><a href=”‘ . home_url() . ‘/store/’ . $tag->slug . ‘/”>’ . $tag->name;
} else {
echo ‘<li><a href=”‘ . home_url() . ‘/store/’ . $tag->slug . ‘/”>’ . $tag->name . ‘<span>(’ . $tag->count . ‘)</span>’;
}
echo ‘</a></li>’ . “\n”;
}
echo ‘</ol></div>’;
}
$cat_id =91;
$current_posts = get_objects_in_term( $cat_id, ‘category’ ); // 表示中のカテゴリーに属する投稿のIDを配列で取得
$current_tags = wp_get_object_terms( $current_posts, ‘post_tag’ ); // 表示中のカテゴリーに属する投稿に付けられたタグの情報をまとめて取得
if ( $current_tags ) {
echo ‘<div class=”ol-circle li-accentbdr acc-bc-before”>’;
echo ‘<ol>’ . “\n”;
foreach ( $current_tags as $tag ) {
if ( $tag->count==1 ) {
echo ‘<li><a href=”‘ . home_url() . ‘/store/’ . $tag->slug . ‘/”>’ . $tag->name;
} else {
echo ‘<li><a href=”‘ . home_url() . ‘/store/’ . $tag->slug . ‘/”>’ . $tag->name . ‘<span>(’ . $tag->count . ‘)</span>’;
}
echo ‘</a></li>’ . “\n”;
}
echo ‘</ol></div>’;
}
?>
スポンサーリンク

