Archive page date logic stopped working
It seems that before and after() don't work with the year as an int, if instead of '2018', you use '2018-01-01', your code works again. Check this.

Basically, use a DateTime object
:)