遵循此步骤:
步骤1:对于不同的部分,可以显示第一篇帖子。当输入此代码时。
<?php
// For your frist post
global $post,$firstPosts;
$args = array(
\'posts_per_page\' => 1,
\'orderby\' => \'post_date\',
\'order\' => \'DESC\',
\'post_type\' => \'post\',
\'post_status\' => \'publish\',
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post();
$firstPosts[] = $post->ID;
echo get_the_title();
endwhile;
endif;
wp_reset_postdata();
?>
第二步:在你的博客页面列表上。输入此代码
Index.php 文件仅适用于回路柱,不包括第一柱
<?php
// blog page
// Put this code after get_header(); line
global $wp_query,$firstPosts;
$args = array_merge( $wp_query->query, array( \'post__not_in\' => $firstPosts ) );
query_posts( $args );
?>