カスタムフィールドの条件が一つの場合
[php]<?php
$args = array(
'posts_per_page' => -1, // 全件取得
'category' => array( 12,14 ), // カテゴリ
'meta_key' => 'finished', //カスタムフィールドのキー
'meta_value'…
以下の例では、カテゴリ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
この投稿へのコメント
コメントはまだありません。