Grid layout “last” class to every third item

I think you just need to start the $count variable from 1 and not zero. You’ll get the opposite effect otherwise because 0 modulo 3 is 0. The first item of every 3 will be getting the class name.

Leave a Comment