single.php 617 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * The Template for displaying all single posts
  4. *
  5. * Methods for TimberHelper can be found in the /lib sub-directory
  6. *
  7. * @package WordPress
  8. * @subpackage Timber
  9. * @since Timber 0.1
  10. */
  11. $context = Timber::context();
  12. $timber_post = Timber::query_post();
  13. $context['post'] = $timber_post;
  14. if ( post_password_required( $timber_post->ID ) ) {
  15. Timber::render( 'single-password.twig', $context );
  16. } else {
  17. Timber::render( array( 'single-' . $timber_post->ID . '.twig', 'single-' . $timber_post->post_type . '.twig', 'single-' . $timber_post->slug . '.twig', 'single.twig' ), $context );
  18. }