timber /timber
Create WordPress themes with beautiful OOP code and the Twig Template Engine
★ 5,653⑂ 504👁 116⑃ 1,582● 1,653▤ 161
+0
日增长
5,653
stars
504
forks
116
watchers
1,582
prs
1,653
issues
161
releases
README
Timber 2.0
By
Jared Novack (@jarednova),
Lukas Gächter (@lgaechter),
Nicolas Lemoine (@nlemoine),
Erik van der Bas (website),
Coby Tamayo (@cobytamayo),
Upstatement and hundreds of other GitHub contributors:
[!NOTE]
Important information about the Timber WordPress plugin
As of Timber version 2.0, Composer is the only supported install method. The Timber plugin on WordPress.org is closed. We advise everyone to switch to the Composer based install of Timber 1 as a first step.
For more information and a list of additional resources, please visit this discussion.
What is Timber?
Because WordPress is awesome, but The Loop isn’t.
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.
This is what Timber's .twig files look like (from this Hello World example)
twig
{% extends "base.twig" %}
{% block content %}
{{ foo }}
{{ post.title }}
{{ post.content }}
{% endblock %}
Once Timber is installed, it gives any WordPress theme the ability to take advantage of the power of Twig and other Timber features.
Documentation
Timber Documentation
Timber 2.0 Upgrade Guide
Twig Reference
Overview / Getting Started Guide
Installation
Follow the Installation Guide for how to install Timber using Composer.
What Now?
Setup the Timber Starter Theme. Once you have that installed in your WordPress setup, continue reading the Getting Started guide to Theming.
Timber’s mission
Timber is a tool for developers who want to translate their HTML into high-quality WordPress themes through an intuitive, consistent and fully-accessible interface.
Intuitive: The API is written to be user-centric around a programmer's expectations.
Consistent: WordPress objects can be accessed through common polymorphic properties like slug, ID and name.
Accessible: No black boxes. Every effort is made so the developer has access to 100% of their HTML.
What does it look like?
Nothing. Timber is meant for you to build a theme on. Like underscores it comes style-free, because you're the style expert. Instead, Timber handles the logic you need to make a kick-ass looking site.
Who is it good for?
Timber is great for any WordPress developer who cares about writing good, maintainable code. It helps teams of designers and developers working together. At Upstatement we made Timber because while our entire team needs to participate in building WordPress sites, not everyone knows the ins-and-outs of the_loop(), codex and PHP (nor should they). With Timber your best WordPress engineer can focus on building the .php files with requests from WordPress and pass the data into .twig files. Once there, designers can easily mark-up data and build out a site's look-andTop issues
#2334Communicate that Timber v2 is more than a templating system for WordPress12 comments · 2020-10-07#2409Cleanup global `$context`9 comments · 2021-01-15#2285WebP filter to generate image srcset for .webp files8 comments · 2020-07-09#1435Timber Resize stretching images7 comments · 2017-05-25#3282`Timber::get_taxonomy` and `Timber::get_taxonomies`6 comments · 2026-08-06#3204Automatically transform field from option page.6 comments · 2026-02-26#3008[BUG] Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated6 comments · 2024-06-05#2866Big ticket about Image handling5 comments · 2023-12-15
Discussions
#3269Watch: Wordpress trac discussion on Composer's inclusion.1 comments · 2026-06-02#3155Installing Composer as a Must-Use Plugin0 comments · 2025-10-20#3152AVIF conversion0 comments · 2025-10-03#3151How to get the attr_title of an item menu1 comments · 2025-09-29#3136Twig Templating Block (powered by Timber)0 comments · 2025-08-15#3098Who is going to WordCamp Europe in Basel in June? Let’s meet up there!4 comments · 2025-04-25#3096How do I get JSON data back into a custom Timber Post object for functional testing?1 comments · 2025-04-15#3095Quick cache question: clear_cache_twig() doesn't seem to be working for me.1 comments · 2025-03-21
Latest release
v2.5.1 v2.5.1 2026-05-292.5.1 (2026-05-29) Bug Fixes Fix bug with WP version notice in admin (3264) (5a26a21) Miscellaneous Chores Update .gitattributes to exclude phpstan.neon.dist and typos.toml from dist (3a226cf)