{% for p in posts %} {% if forloop.counter0|divisibleby:4 %} first {% endif %} {% endfor %}