[英]Returning Loops wordpress
我該如何更改它,所以在前三個帖子之后它會停止循環並在單獨的行中返回其余帖子
<?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.