-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
31 lines (28 loc) · 828 Bytes
/
single.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
// Exit if accessed directly.
if (! defined('ABSPATH')) {
exit;
}
// Ensure Timber is available
if (class_exists('Timber\Timber')) {
$context = Timber\Timber::context();
Timber\Timber::render('templates/index.twig', $context);
} else {
get_header();
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<article <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<div class="post-meta">
<p>Published on <?php echo get_the_date(); ?> by <?php the_author(); ?></p>
</div>
<div class="post-content">
<?php the_content(); ?>
</div>
</article>
<?php endwhile;
else :
echo '<p>No content found.</p>';
endif;
get_footer();
}