0
中结合tax_query和meta_query我尝试使用预定义的meta值获取自定义帖子。查询不返回任何内容。在query_posts()
$args = array
(
'post_type' => 'item',
'nopaging' => true,
'tax_query' => array
( array
(
'taxonomy' => $taxonomy,
'field' => 'term_taxonomy_id',
'terms' => $term_id
)
),
'meta_query' => array(
array(
'key' => 'from_import',
'value' => '1',
)
)
);
$posts = query_posts($args);
当我删除meta_query或tax_query它工作正常。我如何将它结合起来?
谢谢,但没有第二个箭头'tax_query'查询无法过滤结果。 – EOnegin