I need to add a div tag after each 5 items. can any one provide any assistance with this logic, i have tried but, no success.
I have this code:
<div class="product-grid">
<?php foreach ($products as $product) { ?>
<div class="item">.....</div>
<?php } ?>
</div>
I get this
<div class="product-grid">
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
</div>
It would look like this: (add a div after 5 item in sequence.)
<div class="product-grid">
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="clearfix visible-xs-block"></div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="item">.....</div>
<div class="clearfix visible-xs-block"></div>
<div class="item">.....</div>
</div>
Some help would be appreciated.