[php]
<?php
//トップページ以外の場合にnot_homeクラスを追加
$body_class = "";
if ( !is_front_page() ) {
$body_class .= ' not_home';
}
?>
<body id="top" <?php body_class( $body_c…
以下の例では、カテゴリIDが30のカテゴリを親に持つ、子カテゴリ一覧を表示します。
<?php
$categories = get_terms( 'category', array(
'orderby' => 'count',
'hide_empty' => 0,
'child_of' => 30,
) );
foreach($categories as $value):
?>
<p><a href="<?php echo get_category_link($value->term_id); ?>"><?php echo $value->name;?></a></p>
<?php endforeach; ?>
graffiti on the web
この投稿へのコメント
コメントはまだありません。