WordPress theme development - Template Engine

Well there are many themes which uses template engine the one i remember was WP Realia theme which uses Twig template, and you know it's really quite amazing and it handle's it awesomely. I would suggest if you are making bigger wordpress themes then you should use template engines in your theme.

By the way here is a nice article which explains how you can integrate twig template in wordpress


There are lots of alternatives really that provide an alternative to the more traditional templating:

Twig example https://github.com/Rarst/meadow

Timber example http://upstatement.com/timber/

Without need for php coding: Toolset: http://wp-types.com Pods: www.pods.io

Using WP purely as a backend: http://sidigital.co/blog/disconnect-your-frontend-from-wordpress http://www.moma.org/explore/inside_out http://raconteur.net/

Using the JSON api you can implement any of the other client-side templating languages easily too.

I wouldn't necessarily encourage an alternative route like this if the theme is meant to be distributed on .org for example and it's also worth noting that you can get pretty organized with your templates using get_template_part() and maybe complimenting it with a handy theme-wrapper a la Roots or more powerful template logic found in Hybrid-core.

For what it's worth, I've only come across Blade once in a project I was interested in and I found it quite hard to disect as someone totally unfamiliar with it. So depending on your audience, the methodology needs to be weighed against that kind of thing.


Something to consider when choosing a Wordpress starter theme or framework is the community behind it. I would recommend using Timber (or the Timber Starter Theme) instead of Sprig because it is backed by a much larger community:

Sprig on Github: Last updated in Jan 29. 2 contributors

Timber on Github: Last updated yesterday. 62 contributors

Both options use the Twig templating engine.

Finally, I would caution against holding too tightly to the MVC paradigm for your Wordpress theme. Wordpress is event driven, providing action and filter hooks at each stage of the page creation process. In other words, it's more about extending what's already been provided than developing your own MVC abstractions. Here's an article on the subject. Good luck!