Advertisement
5ally

Untitled

Dec 13th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying the homepage when set to a static page. Check
  4.  * the Reading Settings page: Settings -> Reading -> "Your homepage displays".
  5.  */
  6.  
  7. $context = Timber::get_context();
  8. $post = new TimberPost();
  9. $context['post'] = $post;
  10.  
  11. // Add the `carousels` to the Timber's context.
  12. $args = array(
  13. 'post_type' => 'gw_carousel',
  14. 'posts_per_page' => -1,
  15. 'orderby' => array(
  16.     'date' => 'DESC'
  17. ));
  18. $context['carousels'] = Timber::get_posts($args);
  19.  
  20. // Now set Timber to use the front-page.twig template.
  21. Timber::render( array( 'front-page.twig' ), $context );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement