Wordpress 如何在我的博客页面上进行分页?

Wordpress 如何在我的博客页面上进行分页?,wordpress,pagination,Wordpress,Pagination,我有一个显示所有帖子的页面。我使用了以下代码 $args = array( 'numberposts' => 0 ); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

我有一个显示所有帖子的页面。我使用了以下代码

$args = array( 'numberposts' => 0 );
$lastposts = get_posts( $args );
foreach($lastposts as $post) : setup_postdata($post); ?>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content(); ?>
<?php endforeach; ?>
$args=array('numberposts'=>0);
$lastposts=get_posts($args);
foreach($lastposts as$post):设置_postdata($post);?>
上面的代码显示我页面上的所有帖子

但是现在我想在这个页面上进行分页,每页显示3篇博客文章


我将如何做到这一点。请帮忙。

我不知道你为什么用这种奇怪的结构来代替
尝试与
一起进入循环 在那次尝试之后,也许现在可以了,但我不确定你是否可以使用插件,从get_posts改为query_posts,或者你可以使用这个堆栈回答谢谢