-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
71 lines (64 loc) · 1.82 KB
/
single.php
File metadata and controls
71 lines (64 loc) · 1.82 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Template for displaying single posts.
* Post type: post
*
* @since 0.1.0
*/
// Exits if accessed directly.
if ( ! defined('ABSPATH')) {
exit;
}
get_header();
?>
<main id="content" class="content <?php
echo esc_attr(
apply_filters(
'bitski-wp-theme/class/container',
['container-xl'],
true
)
); ?> pt-4 pb-5">
<!-- Content header: post title, thumbnail -->
<header class="content-header mb-4">
<?php
get_template_part('templates/components/post/category-badges'); ?>
<h1 class="post-title"><?php
the_title(); ?></h1>
<?php
get_template_part('templates/components/post/meta', null, ['context' => 'single']); ?>
<?php
if (has_post_thumbnail()) {
$thumbnail_url = get_the_post_thumbnail_url(get_the_ID(), 'medium'); ?>
<img class="post-thumbnail img-fluid rounded mb-3" src="<?php
echo esc_url($thumbnail_url); ?>"
alt="<?php
the_title_attribute(); ?>" loading="lazy">
<?php
} ?>
</header>
<!-- Content body: post content -->
<div class="content-body row">
<div class="col-12">
<div class="post-content">
<?php
the_content(); ?>
</div>
</div>
</div>
<!-- Content footer: adjacent posts -->
<?php
ob_start();
get_template_part('templates/components/post/navigation');
$post_navigation_content = ob_get_clean();
// Only renders the content footer if there is content to display.
if ( ! empty(trim($post_navigation_content))) { ?>
<footer class="content-footer">
<?php
echo $post_navigation_content; ?>
</footer>
<?php
} ?>
</main>
<?php
get_footer(); ?>