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( 'post_type' => '' ) );
- // 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 -->
- THE CODE FOR THE FIRST GROUP OF POSTS GOES HERE
- <!-- End post div -->
- <?php
- // If count is equal to 6
- if( $count == 6 ) :
- // Second query
- $my_second_query = new WP_Query;
- $my_second_query->query( array( 'posts_per_page' => '6' ) );
- // If second query have posts
- if( $my_second_query->have_posts() ) :
- ?>
- <?php
- // While second query have posts
- while( $my_second_query->have_posts() ) : $my_second_query->the_post();
- // Setup vars
- $incr_number_two = get_post_meta( $post->ID, 'incr_number', true );
- ?>
- THE CODE FOR THE SECOND GROUP OF POSTS GOES HERE
- <?php
- // End second while have posts
- endwhile;
- ?>
- <?php
- // End if second query have posts
- endif;
- // End if count is equal to 6
- endif;
- ?>
- <?php
- // End first while have posts
- endwhile;
- // End if first query have posts
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement