Last active
September 20, 2022 13:23
-
-
Save tpitre/74399d6a10c3fc6290b4a65d2871067f to your computer and use it in GitHub Desktop.
WP Timber/Twig Example Usage - Archive WP Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for main archive pages. | |
* | |
* Methods for TimberHelper can be found in the /lib sub-directory | |
* | |
* @package WordPress | |
* @subpackage Timber | |
* @since Timber 0.1 | |
*/ | |
$context = Timber::context(); | |
$context['posts'] = new Timber\PostQuery(); | |
$context['post'] = new TimberPost(); | |
$context['term'] = new Timber\Term(); | |
$templates = array( '05-pages/archive.twig' ); | |
Timber::render( $templates, $context ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment