Please help with $counter
-
I’m making a portfolio page with 3 blocks in a row, about 4 rows down. There is a float:left and margin-right space for all the blocks. I’m using this code to remove the margin from the 3rd block in the row – so it can fit in the #container.
<li class="folio_block <?php if($counter == 2) { echo 'folio_block_last'; $counter=0; } ; $counter++; ?>">
On the first row, the last block has its margin removed but on the second row it does it for the 2nd block.
I tried $counter == 3 but that picks the 4th block. I’m not sure whether it’s a code error or if I’m using floats incorrectly.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Please help with $counter’ is closed to new replies.