要在我的wordpress模板中显示一堆徽标,我需要将存储在高级自定义字段中的一些徽标的输出分组到div中的15个元素中。
我的acutall循环:
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<!-- logo -->
<div class="logo">
<img src="logo.jpg"/>
</div>
<!-- end logo -->
<?php endwhile; ?>
输出应该看起来很糟糕
<div class="logo-wrapper">
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
</div>
<div class="logo-wrapper">
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
<div class="logo"><img src="logo.jpg"</div>
</div>
等等......
答案 0 :(得分:0)
<?php if ($wp_query->current_post < 15) { ?>
</div>
<div class="logo-wrapper">
<?php } ?>