timber 0,0,1,3,0,4,5,1 coveralls editorconfig scrutinizer travis-ci Packagist phpunit

Plugin to write WordPress themes w object-oriented code and the Twig Template Engine

By Jared Novack (@JaredNova) and Upstatement (@Upstatement)

Build Status Coverage Status Dependency Status Scrutinizer Code Quality Latest Stable Version WordPress Download Count Join the chat at https://gitter.im/timber/timber WordPress Rating

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:

{% extends "base.twig" %}
{% block content %}
  <h1 class="big-title">{{ foo }}</h1>
  <h2 class="post-title">{{ post.title }}</h2>
  <img src="{{ post.thumbnail.src }}" />
  <div class="body">
	{{ post.content }}
{% endblock %}

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.

Looking for docs?


The GitHub version of Timber requires Composer. If you’d prefer one-click installation, you should use the WordPress.org version.

composer require timber/timber

If your theme is not setup to pull in Composer’s autoload file, you will need to

require_once(__DIR__ . '/vendor/autoload.php');

at the top of your functions.php file.

Initialize Timber with

$timber = new \Timber\Timber();

Mission Statement

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: All WordPress objects can be accessed through 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 the Starkers or Boilerplate theme 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 dev 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-and-feel.

Related Projects

  • Timber Starter Theme The “_s” of Timber to give you an easy start to the most basic theme you can build upon and customize.
  • Timber Debug Bar Adds a debug bar panel that will show you which template is in-use and the data sent to your twig file.
  • TimberPhoton Plug-in to use JetPack’s free Photon image manipulation and CDN with Timber.
  • Timber CLI A CLI for Timber.
  • Timber Sugar A catch-all for goodies to use w Timber.
  • Timmy Advanced image manipulation for Timber.
  • Twig The template language used by Timber.
  • Pine A CLI installer for timber

Projects that use Timber

  • Gantry5 a framework for theme development
  • Branch Bootstrap + Timber = Branch starter theme!

Helpful Links


Please post on StackOverflow under the “Timber” tag. Please use GitHub issues only for specific bugs, feature requests and other types of issues.

Should I use it?

It’s MIT-licensed, so please use in personal or commercial work. Just don’t re-sell it. Timber is used on hundreds of sites (and tons more we don’t know about)


Read the contributor guidelines in the wiki.


Documentation for Timber classes and functions is auto generated, so any changes to the object reference docs should be made by editing the function’s DocBlock. To make a change to one of the guides, edit the relevant file in the docs directory.

To publish docs:

  1. composer install if not already run
  2. Clone the timber/slate repo at the same directory level as Timber
  3. From the root of the slate directory, run these commands: bash sh publish-docs.sh

Related Repositories



A logger with a small, extensible API which provides utility on top of Android's normal Log class. ...



Plugin to write WordPress themes w object-oriented code and the Twig Template Engine ...



Material Design Music Player ...



The "_s" for Timber: a dead-simple theme that you can build from ...



A android project using Data/Biz/Ui and MVP.该项目演示使用最佳实践来开发Android应用。Dependencies: Dagger, Otto, okhttp, Picasso, Retrofit, Butterknife and Timber.它使用了 分层、MVP、依赖注入、View注解和事件总线等模式。 ...

Top Contributors

jarednova connorjburton mgmartel lggorman alexsomeoddpilot hsz scrutinizer-auto-fixer xavierpriour jnweaver aMoniker parisholley mmikkel FlyingDR xavivars newkind mrgrain slimndap matgargano aaemnnosttv salaros mswartz pkarl aduth kuus LiljebergXYZ josephbergdoll aristath cambell-prince marciojcoelho lucasmichot


package version
dev phpunit/phpunit 5.7.16
wpackagist-plugin/advanced-custom-fields 4.*
wpackagist-plugin/co-authors-plus 3.*
php >=5.3.0|7.*
twig/twig ^1.0|2.*
upstatement/routes 0.4
composer/installers ~1.0
asm89/twig-cache-extension ~1.0


-   v1.0-rc.1 zip tar
-   v0.10.1 zip tar
-   v0.9 zip tar
-   dev-master zip tar
-   15.5 zip tar
-   1.1.6 zip tar
-   1.1.5 zip tar
-   1.1.4 zip tar
-   1.1.3 zip tar
-   1.1.2 zip tar
-   1.1.1 zip tar
-   1.1.0 zip tar
-   1.0.5 zip tar
-   1.0.4 zip tar
-   1.0.3 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar
-   1.0.0-rc3 zip tar
-   1.0-rc2 zip tar
-   0.22.6 zip tar
-   0.22.5 zip tar
-   0.22.4 zip tar
-   0.22.3 zip tar
-   0.22.2 zip tar
-   0.22.1 zip tar
-   0.22.0 zip tar
-   0.21.10 zip tar
-   0.21.9 zip tar
-   0.21.8 zip tar