Skip to content

Instantly share code, notes, and snippets.

@iign
Last active September 27, 2017 19:57
Show Gist options
  • Save iign/1e32c7d485cbd4b87bb20c3471981d95 to your computer and use it in GitHub Desktop.
Save iign/1e32c7d485cbd4b87bb20c3471981d95 to your computer and use it in GitHub Desktop.
<?php
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
Timber::render( array( 'page.example.twig', 'page.twig' ), $context );
{% extends "base.twig" %}
{% block content %}
<article class="section post-type-{{post.post_type}}" id="post-{{post.ID}}">
<div class="wrap">
{{post.content}}
</div>
</section>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment