[英]Returning Loops wordpress
How do i change this so after the first three posts it stops the loop and returns with the rest of the posts in a separate row我该如何更改它,所以在前三个帖子之后它会停止循环并在单独的行中返回其余帖子
<?php
$the_query = new WP_Query( 'posts_per_page=3' );
?>
<?php
while ($the_query -> have_posts()) : $the_query -> the_post();
?>
<div class="col-md-4">
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
<?php the_excerpt(__('(more…)')); ?>
</div>
<?php
endwhile;
wp_reset_postdata();
?>
posts_per_page=3
只会返回 3 个帖子,因此您必须将该值更改为您希望在该页面上显示的帖子数(在您的情况下为摘录)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.