Pages

Wednesday 12 November 2014

Magento Class For Every 5th element

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

No comments:

Post a Comment