所以我有一个wp_query
这是从我的Wordpress网站上获得的5篇最新帖子。我想做的是在这个查询中,抓取最新的帖子并将其显示为一种“英雄”帖子,然后获取其他4篇帖子(如果我以后更改查询,可能会超过4篇),并在这个英雄帖子下面的列表或网格中显示。
以下是我迄今为止的查询代码(明显简化):
<?php
$query_args = array(
"posts_per_page" => "5"
);
$listedPosts = new WP_Query($query_args);
// the loop
if ( $listedPosts->have_posts() ) {
while ( $listedPosts->have_posts() ) {
$listedPosts->the_post();
// loop content for hero post goes here (I need to get the most recent post).
}
}
// how would I show the other remaining posts in the query?
?>