我似乎无法理解这一点。
以下查询工作:
$xxxx = new WP_Query(array(
\'listset\' => \'homepage\',
\'meta_query\' => array(
array (
\'key\' => \'show_home\',
\'value\' => \'true\',
\'compare\' => \'=\'
)
),
\'posts_per_page\' => 1,
\'post_type\' => \'lists\',
\'post_status\' => \'publish\',
\'orderby\' => \'date\',
\'order\' => \'DESC\'
));
以下情况不适用:
$xxxx = new WP_Query(array(
\'tax_query\' => array(
array (
\'taxonomy\' => \'listset\',
\'field\' => \'slug\',
\'terms\' => \'homepage\'
)
),
\'meta_query\' => array(
array (
\'key\' => \'show_home\',
\'value\' => \'true\',
\'compare\' => \'=\'
)
),
\'posts_per_page\' => 1,
\'post_type\' => \'lists\',
\'post_status\' => \'publish\',
\'orderby\' => \'date\',
\'order\' => \'DESC\'
));
谁能帮我弄明白为什么第二个不起作用?