사용자 지정 분류가있는 사용자 지정 게시 유형을 표시하려고하는데 행운이 없습니다. 아무것도 나타나지 않습니다. 어떤 도움을 주셔서 감사합니다.사용자 지정 분류 WP_Query
포스트 유형 = 갤러리
사용자 정의 분류 슬러그 = 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'이 필요합니다. –