Grid layout with Wordpress?

Out of context: Reply #2

  • Started
  • Last post
  • 8 Responses
  • spraycan0

    you need to float the posts in the index.php file then create a separator wich will be echoed every 3 posts(if you want 3 post per row)

    before the loop(this is for a 2 posts per row):
    <?php $count=0 ; ?>

    in the loop:
    <?php $count++;if ($count==2){echo "<div id='separator'></div>";} ?>

    <?php if ($count==4){echo "<div id='separator'></div>";} ?>

    <?php if ($count==6){echo "<div id='separator'></div>";} ?>

    there are many ways for doing this.

    • you should learn about the modulo operatoracescence
    • yes could be done with modulospraycan
    • sorry, i wasn't trying to sound like a smartassacescence
    • ok, i might have a look at it anyway, modulo could be more succinctspraycan

View thread