-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
single-post.php
105 lines (77 loc) · 2.82 KB
/
single-post.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* Single Post
*
* @package WordPress
* @subpackage Fictioneer
* @since 1.0
*/
// Setup
$password_required = post_password_required();
// Header
get_header();
?>
<main id="main" class="main post">
<?php do_action( 'fictioneer_main', 'post' ); ?>
<div class="main__wrapper">
<?php do_action( 'fictioneer_main_wrapper' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
// Setup
$title = fictioneer_get_safe_title( $post->ID, 'single-post' );
$this_breadcrumb = [ $title, get_the_permalink() ];
?>
<article id="post-<?php the_ID(); ?>" class="post__article">
<?php do_action( 'fictioneer_post_article_open', $post->ID, array( 'context' => 'single-post' ) ); ?>
<header class="post__header">
<?php
$header_items = array(
'title' => '<h1 class="post__title">' . $title . '</h1>',
'meta' => '<div class="post__meta layout-links">' . fictioneer_get_post_meta_items() . '</div>'
);
$header_items = apply_filters(
'fictioneer_filter_post_header_items',
$header_items,
$post->ID,
array( 'context' => 'single-post' )
);
echo implode( '', $header_items );
?>
</header>
<section class="post__main content-section"><?php the_content(); ?></section>
<?php do_action( 'fictioneer_post_after_content', $post->ID, array( 'context' => 'single-post' ) ); ?>
<?php if ( ! $password_required && ( has_action( 'fictioneer_post_footer_left' ) || has_action( 'fictioneer_post_footer_right' ) ) ) : ?>
<footer class="post__footer">
<div class="post__footer-box post__footer-left">
<?php do_action( 'fictioneer_post_footer_left', $post->ID, array( 'context' => 'single-post' ) ); ?>
</div>
<div class="post__footer-box post__footer-right">
<?php do_action( 'fictioneer_post_footer_right', $post->ID, array( 'context' => 'single-post' ) ); ?>
</div>
</footer>
<?php endif; ?>
</article>
<?php do_action( 'fictioneer_before_comments' ); ?>
<?php if ( comments_open() && ! $password_required ) : ?>
<section class="post__comments comment-section">
<?php comments_template(); ?>
</section>
<?php endif; ?>
<?php endwhile; ?>
</div>
<?php do_action( 'fictioneer_main_end', 'post' ); ?>
</main>
<?php
// Footer arguments
$footer_args = array(
'post_type' => 'post',
'post_id' => $post->ID,
'breadcrumbs' => array(
[fcntr( 'frontpage' ), get_home_url()]
)
);
// Add current breadcrumb
$footer_args['breadcrumbs'][] = $this_breadcrumb;
// Get footer with breadcrumbs
get_footer( null, $footer_args );
?>