-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
214 lines (178 loc) · 5.63 KB
/
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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
/**
*
* Chooko Lite WordPress Theme by Iceable Themes | https://www.iceablethemes.com
*
* Copyright 2013-2020 Iceable Themes - https://www.iceablethemes.com
*
* Single Post Template
*
*/
get_header();
global $header_image;
?>
<div id="main-content" class="container<?php echo ( ! $header_image ) ? ' no-header-image' : ''; ?>">
<div id="page-container" class="left with-sidebar">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class( 'single-post' ); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="postmetadata">
<span class="meta-date published"><span class="icon"></span>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
<?php the_time( get_option( 'date_format' ) ); ?>
</a>
</span>
<?php
// Echo updated date for hatom-feed - not to be displayed on front end
?>
<span class="updated"><?php the_modified_date( get_option( 'date_format' ) ); ?></span>
<span class="meta-author vcard author"><span class="icon"></span>
<?php
printf(
// Translators: %s is the author's name
wp_kses_post( __( 'by %s', 'chooko-lite' ) ),
'<span class="fn">' . get_the_author() . '</span>'
);
?>
</span>
<?php
if ( has_category() ) :
?>
<span class="meta-category"><span class="icon"></span><?php esc_html_e( 'in', 'chooko-lite' ); ?> <?php the_category( ', ' ); ?></span>
<?php
endif;
if ( comments_open() || '0' !== get_comments_number() ) :
?>
<span class="meta-comments"><span class="icon"></span>
<?php
comments_popup_link(
__( 'No Comment', 'chooko-lite' ),
__( '1 Comment', 'chooko-lite' ),
__( '% Comments', 'chooko-lite' ),
'',
__( 'Comments Off', 'chooko-lite' )
);
?>
</span>
<?php
endif;
edit_post_link(
__( 'Edit', 'chooko-lite' ),
'<span class="editlink"><span class="icon"></span>',
'</span>'
);
?>
</div>
<div class="post-contents">
<?php
if ( '' !== get_the_post_thumbnail() ) : // As recommended from the WP codex, to avoid potential failure of has_post_thumbnail()
?>
<div class="thumbnail">
<a href="<?php the_permalink(); ?>">
<?php
the_post_thumbnail(
'large',
array(
'class' => 'scale-with-grid',
)
);
?>
</a>
</div>
<?php
endif;
the_content();
?>
<div class="clear"></div>
<?php
wp_link_pages(
array(
'before' => '<br class="clear" /><div class="paged_nav"><span class="paged_nav_label">' . __( 'Pages', 'chooko-lite' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'next_or_number' => 'number',
'nextpagelink' => __( 'Next page', 'chooko-lite' ),
'previouspagelink' => __( 'Previous page', 'chooko-lite' ),
'pagelink' => '%',
'echo' => 1,
)
);
the_tags( '<span class="tags"><span>', '</span><span>', '</span></span>' );
?>
</div>
<br class="clear" />
</div>
<div class="page_nav">
<?php
if ( is_attachment() ) :
// Use image navigation links on attachment pages, post navigation otherwise
if ( chooko_adjacent_image_link( false ) ) : // Is there a previous image ?
?>
<div class="previous"><?php previous_image_link( 0, __( 'Previous Image', 'chooko-lite' ) ); ?></div>
<?php
endif;
if ( chooko_adjacent_image_link( true ) ) : // Is there a next image ?
?>
<div class="next"><?php next_image_link( 0, __( 'Next Image', 'chooko-lite' ) ); ?></div>
<?php
endif;
else :
if ( '' !== get_adjacent_post( false, '', true ) ) : // Is there a previous post?
?>
<div class="previous"><?php previous_post_link( '%link', __( 'Previous Post', 'chooko-lite' ) ); ?></div>
<?php
endif;
if ( '' !== get_adjacent_post( false, '', false ) ) : // Is there a next post?
?>
<div class="next"><?php next_post_link( '%link', __( 'Next Post', 'chooko-lite' ) ); ?></div>
<?php
endif;
endif;
?>
<br class="clear" />
</div>
<?php
// Display comments section only if comments are open or if there are comments already.
if ( comments_open() || '0' !== get_comments_number() ) :
?>
<hr />
<div class="comments">
<?php comments_template( '', true ); ?>
</div>
<div class="page_nav">
<?php
if ( '' !== get_adjacent_post( false, '', true ) ) : // Is there a previous post?
?>
<div class="previous"><?php previous_post_link( '%link', __( 'Previous Post', 'chooko-lite' ) ); ?></div>
<?php
endif;
if ( '' !== get_adjacent_post( false, '', false ) ) : // Is there a next post?
?>
<div class="next"><?php next_post_link( '%link', __( 'Next Post', 'chooko-lite' ) ); ?></div>
<?php
endif;
?>
<br class="clear" />
</div>
<?php
endif;
endwhile;
else :
?>
<h2><?php esc_html_e( 'Not Found', 'chooko-lite' ); ?></h2>
<p><?php esc_html_e( 'What you are looking for isn\'t here...', 'chooko-lite' ); ?></p>
<?php
endif;
?>
</div>
<div id="sidebar-container" class="right">
<?php get_sidebar(); ?>
</div>
</div>
<?php
get_footer();