元查询的语法似乎错误。就像税务查询一样,它应该是一个数组,每个元条件对应一个数组。同时使用$query
对于您的查询功能:
$args = array(
\'posts_per_page\' => 3,
\'post_type\' => \'post\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'city\',
\'field\' => \'term_id\',
),
),
\'meta_query\' => array(
array(
\'key\' => \'is_this_featured\',
\'value\' => \'yes\',
\'compare\' => \'LIKE\',
),
),
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
// $ids[] = get_the_ID();
the_title();
the_content();
endwhile;
endif;
wp_reset_query();