Title: Float problem: breaking up the loop?
Last modified: August 19, 2016

---

# Float problem: breaking up the loop?

 *  Resolved [isaidicanshout](https://wordpress.org/support/users/isaidicanshout/)
 * (@isaidicanshout)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/float-problem-breaking-up-the-loop/)
 * my topic might not make sense, but i’m sure visually it will.
 * [http://isaidicanshout.com/news](http://isaidicanshout.com/news)
 * on this category page, i’m hoping to have a grid of posts… 3×3. because they 
   are not all the same size, sometimes objects get caught on each other. i think
   a solution would be to break it into 3 rows: a div of 3, then a div of 3, then
   a div of 3. i’m not sure you can break up the loop like that, though.
 * another alternative that i would accept would be to have all the posts bunch 
   up completely, so there are not large white gaps in between.

Viewing 1 replies (of 1 total)

 *  Thread Starter [isaidicanshout](https://wordpress.org/support/users/isaidicanshout/)
 * (@isaidicanshout)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/float-problem-breaking-up-the-loop/#post-1043118)
 * solved it myself, and completely from scratch! i thought, “hey, if only there
   was a way to do something every 3 posts.” so i wrote this:
 *     ```
       <?php
       $counterface = $counterface + 1;
       if ($counterface =="3") {
         ?> </div><div class="section"> <?php
         $counterface = 0;
       } else {
       }
        ?>
       ```
   
 * each time through the loop, $counterface gets upped by 1. when it hits 3, it 
   resets and opens and closes a div. hooray!

Viewing 1 replies (of 1 total)

The topic ‘Float problem: breaking up the loop?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [isaidicanshout](https://wordpress.org/support/users/isaidicanshout/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/float-problem-breaking-up-the-loop/#post-1043118)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
