Hi there, I want to implement a pure CSS masonry gallery, but this requires modifying a class every 11 items in the loop.
The first 11 items must have a 0:
<li style="--n: 0;">
<figure>
<img...>
</figure>
</li>
And the next 11 items must have a 1 and so on:
<li style="--n: 1;">
<figure>
<img...>
</figure>
</li>
I have read the docs and some related posts, but none seem to achieve precisely what I need, and I’m no good at maths.
My test loop is below, but the output is not even close to what I need.
<Loop acf_gallery="some_gallery">
<figure>
<a href="{Field url size=large}">
<img src="{Field url size=medium}" />
</a>
</figure>
<If check="{Math}{Get loop=count}%12{/Math}" is value=0>
True
<Else />
False
</If>
</Loop>
Can I do this entirely within the loop or do I need to increment a variable outside of the loop? Thanks.