Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $the_query would just be a standard WP_Query
- if ( $the_query->have_posts() ) :
- $counter = 1;
- while ( $the_query->have_posts() ) : $the_query->the_post();
- if ( $counter % columns == 1 ) {
- // do something at the start of your 'row'
- }
- // some content
- // Check if $counter/$columns is equal to an integer
- if ( is_int( $counter / $columns ) ) {
- // do something at the end of your 'row'
- }
- $counter++
- endwhile;
- // Reset WP_Query() data
- wp_reset_postdata();
- endif;
- ?>
Add Comment
Please, Sign In to add comment