page.php 873 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * The template for displaying all pages.
  4. *
  5. * This is the template that displays all pages by default.
  6. * Please note that this is the WordPress construct of pages
  7. * and that other 'pages' on your WordPress site will use a
  8. * different template.
  9. *
  10. * To generate specific templates for your pages you can use:
  11. * /mytheme/templates/page-mypage.twig
  12. * (which will still route through this PHP file)
  13. * OR
  14. * /mytheme/page-mypage.php
  15. * (in which case you'll want to duplicate this file and save to the above path)
  16. *
  17. * Methods for TimberHelper can be found in the /lib sub-directory
  18. *
  19. * @package WordPress
  20. * @subpackage Timber
  21. * @since Timber 0.1
  22. */
  23. $context = Timber::context();
  24. $timber_post = new Timber\Post();
  25. $context['post'] = $timber_post;
  26. Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );