add wp twig functions and update templates to twig format