accueil.php 626 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * template name: Accueil
  4. */
  5. use Timber\Post;
  6. use Timber\Timber;
  7. $context = Timber::get_context();
  8. $post = new Post();
  9. $context['post'] = $post;
  10. $args = 'post_type=post&numberposts=3&orderby=date';
  11. $projet = array(
  12. 'post_type' => 'les-projets',
  13. 'post_status'=>'publish',
  14. 'numberposts' => 3
  15. );
  16. $tpsF = array(
  17. 'post_type' => 'les-temps-forts',
  18. 'post_status'=>'publish',
  19. 'numberposts' => 3
  20. );
  21. $context['projet'] = Timber::get_posts( $projet );
  22. $context['posts'] = Timber::get_posts( $args );
  23. $context['tpsF'] = Timber::get_posts( $tpsF );
  24. Timber::render('accueil.twig', $context);