我想将我的帖子循环到一个2列的网格中,但如果有奇数个帖子,那么在网格的偶数侧会有一个空格。
如果帖子数量为奇数,我如何才能让图像仅出现在这个空白处?所以应该是:
Post 1 | Post 2
Post 3 | img
我试过使用the code here, 但不确定如何应用Modulo
因为图像应该出现在循环之后,不是吗?如果我的代码是超基本的,如:
<div class="small-12 large-6 columns end">
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
Post title, thumbnail, excerpt, etc
<?php endwhile; endif; ?>
</div>