-
Notifications
You must be signed in to change notification settings - Fork 0
/
single.php
170 lines (140 loc) · 4.18 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
<?php
/**
*
* Materia Lite WordPress Theme by Iceable Themes | https://www.iceablethemes.com
*
* Copyright 2017-2020 Iceable Themes - https://www.iceablethemes.com
*
* Single post
*
*/
get_header();
?>
<main class="container">
<?php get_template_part( 'part-title' ); ?>
<div id="single-container" class="single-container with-sidebar">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
/* Post thumbnail ( Featured Image ) */
if ( '' !== get_the_post_thumbnail() ) :
?>
<div class="thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php
endif;
?>
<div class="entry-wrap">
<div class="entry-meta">
<?php
/* Entry title */
?>
<span class="entry-title hatom-feed-info">
<?php the_title(); ?>
</span>
<?php
/* Meta: Date */
?>
<span class="meta-date post-date updated icon-chip link">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><i class="fa fa-calendar" aria-hidden="true"></i>
<?php echo esc_html( get_the_time( get_option( 'date_format' ) ) ); ?>
</a>
</span>
<?php
/* Meta: Author */
$materia_author = sprintf(
'<a class="fn" href="%1$s" title="%2$s" rel="author"><i class="fa fa-user" aria-hidden="true"></i>%3$s</a>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr(
sprintf(
// Translators: %s is the author's name
__( 'View all posts by %s', 'materia-lite' ),
get_the_author()
)
),
get_the_author()
);
?>
<span class="meta-author author vcard icon-chip link">
<?php echo wp_kses_post( $materia_author ); ?>
</span>
<?php
/* Meta: Category */
$materia_cats = array();
foreach ( ( get_the_category() ) as $materia_category ) :
$materia_cats[] = '<span class="meta-category icon-chip link"><a href="' . get_category_link( $materia_category->term_id ) . '"><i class="fa fa-tag" aria-hidden="true"></i>' . $materia_category->cat_name . '</a></span>';
endforeach;
$materia_categories = implode( '', $materia_cats );
echo wp_kses_post( $materia_categories );
?>
</div>
<div class="post-content entry-content">
<?php the_content(); ?>
</div>
<?php
wp_link_pages(
array(
'before' => '<br class="clear" /><div class="paged_nav"><span>' . __( 'Pages:', 'materia-lite' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'next_or_number' => 'number',
'nextpagelink' => __( 'Next page', 'materia-lite' ),
'previouspagelink' => __( 'Previous page', 'materia-lite' ),
'pagelink' => '%',
'echo' => 1,
)
);
?>
</div>
<?php
/* Meta: Tags */
if ( has_tag() ) :
?>
<div class="entry-footer">
<?php
echo '<span class="meta-tags">';
$materia_tags = get_the_tag_list( '', ', ', '' );
printf(
// Translators: %s is a list of tags
esc_html__( 'Tagged with %s', 'materia-lite' ),
wp_kses_post( $materia_tags )
);
echo '</span>';
?>
</div>
<?php
endif;
?>
</div>
<?php
materia_article_nav();
// Display comments section only if comments are open or if there are comments already.
if ( comments_open() || '0' !== get_comments_number() ) :
?>
<div class="comments">
<?php comments_template( '', true ); ?>
</div>
<?php
materia_article_nav();
endif;
endwhile;
else : // Empty loop ( this should never happen! )
?>
<h2><?php esc_html_e( 'Not Found', 'materia-lite' ); ?></h2>
<p><?php esc_html_e( 'What you are looking for isn\'t here...', 'materia-lite' ); ?></p>
<?php
endif;
?>
</div>
<div id="sidebar-container">
<?php get_sidebar(); ?>
</div>
</main>
<?php
get_footer();