我已经重写了query_posts
. 至于get_posts
您最好使用WP\\u查询,因为可以更好地控制tax\\u查询。Explained here.
<?php
$args = array(
\'cat\' => 84,
\'posts_per_page\' => 3,
\'offset\' => 0,
\'tax_query\' => array(
\'relation\' => \'NOT IN\',
array(
\'taxonomy\' => \'display\',
\'field\' => \'slug\',
\'terms\' => \'featured-slider\'
)
)
);
$wpse42083_query = new WP_Query( $args );
while( $wpse42083_query->have_posts() ) : $wpse42083_query->the_post();
// write post stuff in here
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
编辑:我添加了用法。