您好,我有post\\u type“product”和taxonomy“price”,有人能帮我用所选的分类法查询自定义post类型吗?
我当前的代码如下
<?php $term = get_term_by( \'slug\', get_query_var( \'term\' ), get_query_var( \'taxonomy\' ) );
$args = array(
\'post_type\' => \'product\',
\'posts_per_page\' => 5,
\'tax_query\' => array(
array(
\'taxonomy\' => \'productcategories\',
\'terms\' => $term->name
)
)
);
query_posts($args);
print_r($args);
?>
但没有结果,有人能帮我吗?非常感谢。