你应该看看WP_Query. 以下参数应该是您所需要的。请注意tax_query
获取数组的数组。
$args = array(
\'post_type\' => array( \'post\', \'videos\', \'music\' ),
\'tax_query\' => array(
array(
\'taxonomy\' => \'content\',
\'field\' => \'slug\',
\'terms\' => \'indy\',
\'operator\' => \'NOT IN\'
)
)
);
$myquery = new WP_Query( $args );
while( $myquery->have_posts() ):
$myquery->the_post();
# do your stuff here
endwhile;