我会这样做:
$excluded_posts = array();
// select first 3 featured posts ordered by date
$args = array (
\'post_type\' => array( \'post\' ),
\'category_name\' => \'featured\',
\'posts_per_page\' => \'3\',
\'order\' => \'DESC\',
\'orderby\' => \'date\',
\'ignore_sticky_posts\' => true, // or maybe not?
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) { $query->the_post();
$excluded_posts[] = get_the_ID();
}
wp_reset_postdata();
// select first 3 news ordered by date
$args[\'category_name\'] = \'news\';
$query = new WP_Query( $args );
while ( $query->have_posts() ) { $query->the_post();
$excluded_posts[] = get_the_ID();
}
wp_reset_postdata();
$args = array (
\'post__not_in\' => $excluded_posts,
\'ignore_sticky_posts\' => true,
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) { $query->the_post();
// finally loop with last 10 without last 3 news and featured posts
}
wp_reset_postdata();