私はカスタム分類を持つカスタム投稿タイプを表示しようとしていますが、運がないわけではありません。何も表示されません。私はどんな助けにも感謝します。カスタム分類WP_Query
ポストタイプ=ギャラリー
カスタム分類スラグ= photoarea
'photoarea' 私がいることを、私の理解が正しければ=第四
<?php
$args = array(
'post_type' => 'gallery',
'tax_query' => array(
array(
'taxonomy' => 'photoarea',
'field' => 'fourth',
)
),
'posts_per_page' => 10,
);
$the_query = new WP_Query($args);
if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post();
the_post_thumbnail();
endwhile; endif;
wp_reset_query();
?>
私のためには機能しません。これは、PHP通知をトリガします。 –
'term'ではなく 'field' => 'slug'と 'terms' => 'fourth'が必要です。 –