1- Take a variable and assign to 0. like

<?php $counter=0; ?>

2- And give the condition in the li tag as follows.

<li class="product <?php if($counter%5==4): echo "last";  endif;?>"> // for fifth element

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *