Description

Timber helps you create fully-customized WordPress themes faster with more sustainable code. With Timber, you write your HTML using the Twig Template Engine separate from your PHP files. This cleans up your theme code so, for example, your PHP file can focus on being the data/logic, while your Twig file can focus 100% on the HTML and display.

Once Timber is installed and activated in your plugin directory, it gives any WordPress theme the ability to take advantage of the power of Twig and other Timber features.

{{ message }}

Tens of thousands of sites now use Timber. You can check some of them out in the Showcase.

Doesn’t this all make WordPress harder since there’s more to learn?

Does jQuery make JavaScript harder? Yes, it’s an extra piece to learn — but it super-charges your ability to write unencumbered JavaScript (and prevents you from having to learn lots of the messy internals). If your answer is “jQuery sucks and everyone should learn how to write vanilla JavaScript or they’re rotten stupid people,” this tool isn’t for you.

Oh, Timber is simple code so it’s for making simple themes

Whatever. It simplifies the silly stuff so that you can focus on building more complicated sites and apps. jQuery simplifies Javascript, but you can still use the full range of JavaScript’s abilities.

Will you support it?

At Upstatement we’re using it in dozens of sites (and many more planned) — thousands of other developers are using it too. This isn’t going anywhere. Twig is the chosen language for other PHP platforms like Symfony, Drupal 8 and Craft.

Reviews

Without Timber I would have given up on WordPress. I’m a big Rails developer and Timber is the only way I can stand WordPress. WordPress should consider this the primary templating engine for the it’s next major release. Thanks Timber team!

WordPress way of creating templates leads to messy, hard-to-read, hard-to-reuse and hard-to-maintain code. There are of course ways how to prevent it a bit, but this plugin solved the issue for me completely. Twig is a great templating engine by itself and Timber connects it nicely to WordPress with WordPress specific objects.

1.4.0

Changes for Theme Developers
– Improve loader performance and logic #1476 #1489 #1491 (thanks @heino). This introduces potential changes if you were loading templates in a non-standard way and with multiple sources (ex: from a theme and plugin directory). Non-existing templates are no longer passed all the way to Twig’s render(), which currently generates an exception.

Exposing a function to global Twig scope through Timber\FunctionWrapper is deprecated, the preferred method to do this is through a Twig template like {{ function('my_cool_function', 'my_argument') }} (thanks @gchtr)

Fixed issues with use of Twig 2.0 (#1370)

Fixed up some things with Timber/Archives and getting post_count #1376