I am trying to detect each 4th post to insert extra code in my layout in wordpress using modulus method but I just cant get it.
Here is a short example of mine:
You need to start your counter at 1, as you are increasing it at the end of the loop:
Either that, or you increase it at the start of the loop / before the check: