Skip to content

NewCity Article: Building Sane, Reusable WordPress Templates with Timber and Twig

Published: at 12:00 AM

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.

This article is adapted from a talk I gave at WPCampus 2017.