Title: Three loop horizontal post sequence
Last modified: August 19, 2016

---

# Three loop horizontal post sequence

 *  [KostRev](https://wordpress.org/support/users/kostrev/)
 * (@kostrev)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/three-loop-horizontal-post-sequence/)
 * Hello,
    I have a three column layout with three loops. I’d like to display my
   posts in a horizontal sequence across the three columns and am having trouble
   creating the correct operations.
 * This is my test site:
    [http://teen.mam.org.php5-9.websitetestlink.com/](http://teen.mam.org.php5-9.websitetestlink.com/)
 * My first loop starts with:
 *     ```
       <?php
       if (have_posts()) :
       while(have_posts()) :
       $i++;
       if($i % 2 == 0) : $wp_query->next_post();
       else : the_post();
       ?>
       ```
   
 * My second loop starts with:
 *     ```
       <?php
       if (have_posts()) :
       while(have_posts()) : $i++;
       if(($i % 2) !== 0) : $wp_query->next_post();
       else : the_post(); ?>
       ```
   
 * Basically that sorts even and odd numbered posts. And the third loop I am at 
   a loss. I need each loop to increment by 3. I’d like operations that would create
   something like this:
 * Column One:
    post 1 post 4 post 7 post 10
 * Column Two:
    post 2 post 5 post 8 post 11
 * Column three:
    post 3 post 6 post 9 post 12
 * Any help would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [cynstahl](https://wordpress.org/support/users/cynstahl/)
 * (@cynstahl)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/three-loop-horizontal-post-sequence/#post-858440)
 * instead of three loops, have you tried displaying your posts as an inline-table?
 * all you need to do is create a new div class under your while (have_posts()) 
   line. in your style sheet set the class to display as an inline table. to control
   the number of columns, set the class to a specific width so only three will fit
   across.
 *  [charmedworks](https://wordpress.org/support/users/charmedworks/)
 * (@charmedworks)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/three-loop-horizontal-post-sequence/#post-858522)
 * hi cynstahl
 * Are you willing to provide a little more specifics for your recommedation? I 
   am trying to work this with little success.
 * My code looks like this:
 * Loop
 *     ```
       <?php query_posts('cat=7&showposts=7'); ?>	<?php while (have_posts()) : the_post(); ?>
       <div class="portfolio">
   
       <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_excerpt(); ?></a>
   
       </div>
   
       <?php endwhile; ?>
       ```
   
 * Stylesheet
 *     ```
       .portfolio {
       	display:inline-table;
       	width:200px;
       }
       ```
   
 * Here is the display of the page:
 * [http://inglisart.com/?page_id=65](http://inglisart.com/?page_id=65)
 * It’s… sort of working in Firefox, but not in IE. Any advice is much appreciated!
 *  [charmedworks](https://wordpress.org/support/users/charmedworks/)
 * (@charmedworks)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/three-loop-horizontal-post-sequence/#post-858523)
 * hi again,
 * I have deactivated the pages above because I found another solution, presented
   here:
    [http://perishablepress.com/press/2008/09/01/multiple-loops-and-multiple-columns-with-wordpress/](http://perishablepress.com/press/2008/09/01/multiple-loops-and-multiple-columns-with-wordpress/)
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Three loop horizontal post sequence’ is closed to new replies.

## Tags

 * [three column](https://wordpress.org/support/topic-tag/three-column/)

 * 3 replies
 * 3 participants
 * Last reply from: [charmedworks](https://wordpress.org/support/users/charmedworks/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/three-loop-horizontal-post-sequence/#post-858523)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
