0
私は小さな問題が1つあります。カテゴリページのカテゴリのカスタムフィールドを表示しています。その罰金を示しています。そのカテゴリに投稿がない場合は表示されません。Wordpressは投稿がない場合でもカテゴリフィールドを取得します
私のコードで 'hide_empty' => 0を使用する場所はわかりません。
ここでは、カテゴリのフィールドを表示するために使用したコードです。
$terms = get_the_terms(get_the_ID(), 'category');
if(!empty($terms)) {
$term = array_pop($terms);
$expert_photo = get_field('expert_photo',$term);
$expert_name = get_field('expert_name',$term);
$expert_title = get_field('expert_title',$term);
$expert_description = get_field('expert_description',$term);
$expert_introduction = get_field('expert_introduction',$term);