我使用该查询显示某些职位。
query_posts( array(
'post_type' => APP_POST_TYPE,
'post_status' => 'publish',
'posts_per_page' => 4,
APP_TAX_STORE => $term->slug,
),
) );
现在,而不是显示APP_TAX_STORE => $term->slug
的所有帖子,我想将它们排除在外。我想在这种形式中找到的所有解决方案,但毫无效果。有任何想法吗?
您可以使用tax_query
。
query_posts( array(
'post_type' => APP_POST_TYPE,
'post_status' => 'publish',
'posts_per_page' => 4,
'tax_query' => array(
array(
'taxonomy' => APP_TAX_STORE,
'field' => 'slug',
'terms' => $term->slug,
'operator' => 'NOT IN',
),
),
) );