或者使用tag_not_in
参数,如果您有标记id,如果没有,则可以使用tax_query
这样的参数:
$tag_to_exclude = \'example_tag\';
$args = array(
\'posts_per_page\' => -1,
\'tax_query\' => array(
array(
\'taxonomy\' => \'post_tag\',
\'field\' => \'slug\',
\'terms\' => array($tag_to_exclude),
\'operator\' => \'NOT IN\',
)
);
query_posts($args);