我有一个很好用的wp\\u查询,但我不能同时有元查询和tax\\u查询。
<?php
$event_query = new WP_Query(
array(
\'post_type\' => \'event\', // only query events
\'meta_key\' => \'event-date\', // load up the event_date meta
\'orderby\' => \'meta_value\',
\'order\' => \'asc\', // ascending, so earlier events first
\'posts_per_page\' => \'-1\',
\'meta_query\' => array(
array( // restrict posts based on meta values
\'key\' => \'event-date\', // which meta to query
\'value\' => date("Y/m/d"), // value for comparison
\'compare\' => \'>\', // method of comparison
\'type\' => \'DATE\' )
),
\'tax_query\' => array(
array(
\'taxonomy\' => \'event_category\',
\'field\' => \'slug\',
\'terms\' => $term_id,
\'operator\' => \'IN\')
),
) // end array
); // close WP_Query constructor call
?>
我正在尝试在taxonomy$term\\u id中查找所有事件,然后确保它们都是将来发生的,并按ASC排序
有什么想法吗?