/
content.php
112 lines (68 loc) · 2.5 KB
/
content.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
106
107
108
109
110
111
112
<article <?php post_class( 'section-inner' ); ?> id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="featured-media">
<?php the_post_thumbnail(); ?>
</div><!-- .featured-media -->
<?php endif; ?>
<header class="entry-header">
<?php
the_title( '<h1 class="entry-title">', '</h1>' );
if ( has_excerpt() ) :
?>
<div class="intro-text">
<?php the_excerpt(); ?>
</div>
<?php
endif;
// Single top post meta
miyazaki_the_post_meta( $post->ID, 'single-top' );
?>
</header><!-- .entry-header -->
<div class="post-inner">
<div class="entry-content">
<?php
the_content();
wp_link_pages();
edit_post_link( __( 'Edit', 'miyazaki' ), '<p>', '</p>' );
?>
</div><!-- .entry-content -->
<?php
if ( is_single() ) :
// Single bottom post meta
miyazaki_the_post_meta( $post->ID, 'single-bottom' );
// Single pagination
$next_post = get_next_post();
$prev_post = get_previous_post();
if ( $next_post || $prev_post ) :
$pagination_classes = '';
if ( ! $next_post ) {
$pagination_classes = ' only-one only-prev';
} elseif ( ! $prev_post ) {
$pagination_classes = ' only-one only-next';
}
?>
<nav class="pagination-single<?php echo $pagination_classes; ?>">
<?php if ( $prev_post ) : ?>
<a class="previous-post" href="<?php echo esc_url( get_permalink( $prev_post->ID ) ); ?>">
<span class="arrow"><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/icons/arrow-left.svg" /></span>
<span class="title"><?php echo wp_kses_post( get_the_title( $prev_post->ID ) ); ?></span>
</a>
<?php endif; ?>
<?php if ( $next_post ) : ?>
<a class="next-post" href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>">
<span class="arrow"><img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/icons/arrow-right.svg" /></span>
<span class="title"><?php echo wp_kses_post( get_the_title( $next_post->ID ) ); ?></span>
</a>
<?php endif; ?>
</nav><!-- .single-pagination -->
<?php
endif;
// If comments are open, or there are at least one comment
if ( ( comments_open() || get_comments_number() ) && ! post_password_required() ) : ?>
<div class="comments-wrapper">
<?php comments_template(); ?>
</div><!-- .comments-wrapper -->
<?php endif; ?>
<?php endif; ?>
</div><!-- .post-inner -->
</article><!-- .post -->