<?php
$args = array(
'post_type' => 'college',
'posts_per_page' => -1,
'order' => 'DESC',
'orderby' => 'menu_order'
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-3">
<?php the_title(); ?>
</div>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
Hi,
I’ve never done this before. I’m trying to wrap every 4 posts in the loop above inside a <div class="row"></div>
This should sort you out
Adapted from Wrapping a div around every third item in a foreach loop PHP
You can follow my code, post of @chapskev is good but missing a closing div after end if