ankara escort bayan ankara escort bayan ankara escort
How to loop all pages but wrap every 3 with a div - WpDevcodes

How to loop all pages but wrap every 3 with a div

<div class="row">
<?php $count=0;
if(have_rows('directory_rep')): while(have_rows('directory_rep')) : the_row();
?>
<?php if($count==0 || $count==3) { ?>
<div class="col-sm-6">
<?php } ?>
<div class="card">
<p><?php the_sub_field('title_area'); ?></p>
</div>
<?php if($count== 2 || $count==5) { ?>
</div>
<?php } ?>
<?php $count++; ?>
<?php endwhile; endif; ?>
</div>