• i want t o put every 3 posts in one line
    i use table but how to do that every 3 posts there will be closing tag </tr>(to open new line)?
    maybe something with css and not condition of php because i know the max width of evry posts (small posts)

Viewing 1 replies (of 1 total)
  • Use code similar to this to put three posts on a row:

    $cell = 0;
    echo '<tr>';
    while (have_posts()) : the_post();
       if (++$cell > 3) {  // Have we already done 3 posts?
          echo '</tr><tr>';  // Yes, end the row and start a new one
          $cell = 1;
       }
       // rest of the loop
    <?php endwhile;
    echo '</tr>'; ?>
Viewing 1 replies (of 1 total)

The topic ‘Need some css help with posts location’ is closed to new replies.