Skip to content

tuxedosoft/timber

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timber 2.0 For ClassicPress 2

What is Timber For ClassicPress?

Timber helps you create fully-customized WordPress/ClassicPress 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)

This version of Timber has been made to be compatible with ClassicPress 2.

{% 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 }}
  </div>
{% endblock %}

Once Timber is installed, it gives any WordPress/ClassicPress theme the ability to take advantage of the power of Twig and other Timber features.

Documentation


Installation

Use Composer to install.

composer require tuxedosoft/timber

Main Difference From The WordPress Version

This version does away with the Blocks check. ClassicPress does not use the Blocks Editor.

About The StarterSite

The StarterSite.php allows Timber's Starter Theme (or your Timber theme) to 'play nice' with ClassicPress. It does away with the add_theme_support('html5') since starting from ClassicPress 2 add_theme_support('html5') is deprecated.

Simply, copy this file and replace the src/StarterSite.php in your Timber theme for things to work right.

Who is it good for?

Timber is great for any WordPress/ClassicPress developer who cares about writing good, maintainable code. It helps teams of designers and developers working together. With Timber your best WordPress/ClassicPress engineer can focus on building the .php files with requests from WordPress/ClassicPress and pass the data into .twig files. Once there, designers can easily mark-up data and build out a site's look-and-feel.

Should I use it?

Timber is MIT-licensed, so please use in personal or commercial work. Just don't re-sell it.

Documentation

The Official Documentation for Timber.

About

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

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.1%
  • Other 0.9%