Adding a clearing div to every third post in the loop
-
Hi there, I need to add a clearing div to the end of every third post in the loop (three posts per row).
It’s currently working using
<?php
if (0 == $count%3) {
echo ‘<div class=”clear”></div>”‘;
}
?>However, if a third post isn’t there, the clearing div won’t appear which is not what I want.
Say for instance, I only have one post in a row, how would I add the clearing div and the same question if I only have two posts in a row.
Any help is very much appreciated,
Thanks,
Dan
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Adding a clearing div to every third post in the loop’ is closed to new replies.