0
"내 프로젝트"의 사용자 정의 게시 유형을 쿼리하고 "custom_featured"확인란을 선택한 모든 게시물을 반환하려고합니다. 이것은 내 현재 쿼리입니다. 그러나 체크 박스가 선택된 여러 게시물이 있지만 아무것도 반환하지 않습니다.체크 박스 값을 기반으로하는 Wordpress 쿼리
$args = array(
'post_type' => 'projects',
'meta_query' => array(
array(
'key' => 'custom_featured',
'value' => 'true',
'compare' => '='
)
)
);
$my_query = new WP_Query($args);
if($my_query->have_posts()) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink();?>">
<h1><?php the_title(); ?> </h1>
</a>
<?php endwhile;
}
wp_reset_query();
귀하의 질문은 내게 적용됩니다 –