嘿,我有這個WordPress的設置,我不是一個真正的PHP開發人員。我想要實現的是循環來排除最後創建的3個帖子。有沒有辦法去做到這一點?循環問題,我想去年3排除
<div class="grid">
<?php
// Start the loop.
while (have_posts()) : the_post(); ?>
<div class="col-sm-6 col-lg-4">
<?php get_template_part('content', 'square'); ?>
</div>
<?php
// End the loop.
endwhile; ?>
</div><!-- .grid -->
<?php the_posts_pagination(array('mid_size' => 2, 'prev_text' => '<span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>', 'next_text' => '<span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>'));
// If no content, include the "No posts found" template.
else :
get_template_part('content', 'none');
endif;
?>
它可能更適合這樣做,因爲自定義查詢... – rnevius