Timber

Timber

timber-logo
Timber is a great plugin for those PHP developers who like to use the Twig Templating Language. It extends the standard Twig install with support for many of the built in WordPress objects and variables necessary for theme development.

Check out more here Timber Library

It is easy to use once installed.  The snippet below shows how to load posts into the Timber context and then render the index template unless is_home() returns true in which case it will render the home template.

$context = Timber::get_context();
$context['posts'] = Timber::get_posts();
$templates = array( 'index.twig' );
if ( is_home() ) {
    array_unshift( $templates, 'home.twig' );
}
Timber::render( $templates, $context );