Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // First query
- $my_query = new WP_Query;
- $my_query->query( array( 'numberposts' => '6' ) );
- // If first query have posts
- if( $my_query->have_posts() ) :
- $count = 0;
- // While first query have posts
- while ($my_query->have_posts()) : $my_query->the_post();
- // Setup vars
- $count++;
- $incr_number = get_post_meta( $post->ID,'incr_number',true);
- ?>
- <!-- start post -->
- FIRST GROUP OF POSTS CODE
- <!-- end post -->
- <?php
- // If count is equal to 6
- if($count % 6 ==0 && $count !=0) :
- // Second query
- $my_second_query = new WP_Query;
- $my_second_query->query('offset='.$myOffset.'&showposts=6');
- // If second query have posts
- if( $my_second_query->have_posts() ) :
- // While second query have posts
- while( $my_second_query->have_posts() ) : $my_second_query->the_post(); $myOffset++; ?>
- <!-- start post -->
- SECOND GROUP OF POSTS CODE
- <!-- end post -->
- <?php endwhile; ?>
- <?php
- // End if second query have posts
- endif; ?>
- <?php
- // End if second query have posts
- endif; ?>
- <?php
- // End first while have posts
- endwhile; ?>
- <?php
- // End if first query have posts
- endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement