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:
https://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 10Column Two:
post 2
post 5
post 8
post 11Column three:
post 3
post 6
post 9
post 12Any help would be greatly appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Three loop horizontal post sequence’ is closed to new replies.