timber /timber

Create WordPress themes with beautiful OOP code and the Twig Template Engine

★ 5,653⑂ 504👁 116⑃ 1,582● 1,653▤ 161
PHPMITCreated 2013-01-02timber.github.io/docs/
下载:v2.5.1v2.5.1 ↓2.5.12026-05-29
+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-and

Top issues

Discussions

Latest release

v2.5.1 v2.5.1 2026-05-29
2.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)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON