Forum

Thread tagged as: Question, Blog

Blog post for_every

Hi all

i need a little help

the below code works fine

but the first item gets the class large-4

and my 6th item also gets large-4 when i need it to be large-6

<div class="
<perch:if exists="perch_item_first"> large-6 </perch:if>
<perch:every nth-child="2n"> large-6 </perch:every>
<perch:every nth-child="3n"> large-4 </perch:every>
<perch:every nth-child="4n"> large-4 </perch:every>
<perch:every nth-child="4n+1"> large-4 </perch:every> columns <perch:if exists="perch_item_last"> end </perch:if>">
Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's 4n+1 that applies large-4 to the first item.

3n applies large-4 to the 6th item.

https://nth-test.com

Ooo thats a good website thanks