您必须使用2个查询,其中在第一个循环中,您应该使用:
$args = array(
"post_type" => "post",
"post_status" => "publish",
"orderby" => "date",
"order" => "DESC",
"posts_per_page" => 20,
\'post__in\' => cat,
);
(The Query)
在第二种情况下:
$args = array(
"post_type" => "post",
"post_status" => "publish",
"orderby" => "date",
"order" => "DESC",
"posts_per_page" => 20,
\'post__not_in\' => cat,
);
(The Query)
这应该是可行的,因为第一个循环将只接收来自
cat
第二个循环是所有其他循环,第一个循环将始终保持在顶部,虽然我不知道这样分页是否会有问题,但您还应该确保用
wp_reset_query();
例如