Rewrote functions isPost and isPage as Twig tests