【发布时间】:2015-04-06 09:42:56
【问题描述】:
如何仅在插入 <br style="clear: both" /> 后的第一个完整行之后才插入 Google 广告代码,然后允许循环继续添加 <br style="clear: both" />,而不添加广告代码,直到完成。
这是我正在尝试编辑的代码,目前它会一直处理,直到显示所有图像。每行有 4 张图片宽,在第四张图片之后插入 <br style="clear: both" /> 并开始下一行。
<?php if ($number_of_columns > 0 && empty($show_all_in_lightbox)): ?>
<?php if ((($i + 1) % $number_of_columns) == 0 ): ?>
<br style="clear: both" />
<?php endif; ?>
<?php endif; ?>
这里是声明
<?php for ($i=0; $i<count($images); $i++):
$image = $images[$i];
$thumb_size = $storage->get_image_dimensions($image, $thumbnail_size_name);
$style = isset($image->style) ? $image->style : null;
【问题讨论】: