NewCity

Building Sane, Reusable WordPress Templates with Timber and Twig

An image of the author with Hulk hands shares the foreground with an illustrated ninja over a backdrop of code

Traditional WordPress templates are written in PHP code that mixes HTML output with more advanced programming logic. The Timber plugin for Wordpress lets you move the markup part of your templates into separate files written in Twig, a simple yet powerful templating language. When you separate logic from layout in this way, your themes will be easier to read, easier to edit, and more portable.