Last active
December 22, 2015 11:19
-
-
Save jarednova/6464926 to your computer and use it in GitHub Desktop.
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 | |
$data = Timber::get_context(); | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
query_posts('posts_per_page=2&paged='.$paged); | |
$posts = Timber::get_posts(); | |
$data['posts'] = $posts; | |
$data['pagination'] = Timber::get_pagination(); | |
Timber::render('date.twig', $data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So get_pagination() relies on using the current query. Even though you're sending new data to Timber::get_posts(); the original query is unaffected.
To modify that query you just need to send query_posts the new info (which modifies the WP loop). In a future release I'll make it so this happens automatically.