first commit
This commit is contained in:
20
single.php
Normal file
20
single.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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 );
|
Reference in New Issue
Block a user