JeremyEnglert / JointsWP

A blank WordPress theme built with Foundation 6, giving you all the power and flexibility you need to build complex, mobile friendly websites without having to start from scratch.
http://jointswp.com
851 stars 272 forks source link

Using Timber / Twig with this theme #395

Closed HongPong closed 5 years ago

HongPong commented 5 years ago

Looking at this nice theme, wondering if there is a good way to use Timber/Twig techniques with it instead of the standard PHP.

In other contexts I have enjoyed splitting the PHP away from the front templating. Timber is the premiere twig framework for WordPress AFAIK. It can be run as a plugin that then provides the required functions to themes:

Some other people tried earlier with this idea combining Timber and Foundation:

Why Twig? as said here PHP wasn't intended for templating:

One argument against doing this is that it requires composer to develop from Github as discussed here

Video tutorials are located here:

Michael-Ashfield commented 5 years ago

You can use timber/twig with this theme. Make anew folder called "Views" and put any twig files in there, you can add the context to a custom page template. This is how I do it on my sites, as long as you understand Timber.

HongPong commented 5 years ago

ok thanks for getting back to me!