if (currentPage && numberOfSpecialPages === 2)

better this IMHO, it works when there are search provider or not

NO search provider -> numberOfSpecialPages === 1
search provider (ev.me) -> numberOfSpecialPages === 2