You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
469 B
20 lines
469 B
<?php
|
|
/**
|
|
* The Template for displaying all single posts
|
|
*
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use Timber\Timber;
|
|
|
|
$context = Timber::context();
|
|
$post = $context['post'];
|
|
$templates = [ 'templates/single-' . $post->post_type . '.twig', 'templates/single.twig' ];
|
|
|
|
if ( post_password_required( $post->ID ) ) {
|
|
$templates = 'templates/single-password.twig';
|
|
}
|
|
|
|
Timber::render( $templates, $context );
|
|
|