1 2 3 4 5 6 7 8 |
<?php $term_id = ●;//カテゴリーID。管理画面でカテゴリー表示をし、URLで確認できます。親タームとして判別するIDを入れる $taxonomy_name = '▲'; $termchildren = get_term_children( $term_id, $taxonomy_name ); foreach ( $termchildren as $child ) :?> <?php $term = get_term_by( 'id', $child, $taxonomy_name );?> <p><a href="<?php echo get_term_link( $child, $taxonomy_name );?>"><?php echo $term->slug; ?><?php echo $term->name;?></a></p> <?php endforeach; ?> |