• Resolved isaidicanshout

    (@isaidicanshout)


    my topic might not make sense, but i’m sure visually it will.

    https://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

    (@isaidicanshout)

    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.