-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
216 lines (178 loc) · 5.2 KB
/
index.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
215
216
<?php
/**
*
* Blackoot Lite WordPress Theme by Iceable Themes | https://www.iceablethemes.com
*
* Copyright 2014-2020 Iceable Themes - https://www.iceablethemes.com
*
* Main Index
*
*/
get_header();
get_template_part( 'part-title' );
?>
<div id="main-content" class="container">
<div id="page-container" class="with-sidebar">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php
/* Post thumbnail (Featured Image) */
if ( '' !== get_the_post_thumbnail() ) : // As recommended from the WP codex, has_post_thumbnail() is not reliable
?>
<div class="thumbnail">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php
the_post_thumbnail(
'post-thumbnail',
array(
'class' => 'scale-with-grid',
)
);
?>
</a>
</div>
<?php
endif;
/* Post Metadata */
?>
<div class="postmetadata">
<?php
if ( 'post' === get_post_type() ) :
/* Meta: Date */
?>
<span class="meta-date post-date updated"><i class="fa fa-calendar"></i><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark">
<?php
the_time( get_option( 'date_format' ) );
?>
</a></span>
<?php
/* Meta: Author */
$author = sprintf(
'<a class="fn" href="%1$s" title="%2$s" rel="author">%3$s</a>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
// Translators: %s is the author's name
esc_attr( sprintf( __( 'View all posts by %s', 'blackoot-lite' ), get_the_author() ) ),
get_the_author()
);
?>
<span class="meta-author author vcard"><i class="fa fa-user"></i>
<?php echo wp_kses_post( $author ); ?>
</span>
<?php
/* Meta: Category */
?>
<div class="meta-category">
<span class="category-icon" title="<?php esc_attr_e( 'Category', 'blackoot-lite' ); ?>"><i class="fa fa-tag"></i></span>
<?php
foreach ( get_the_category() as $category ) :
echo '<a href="', esc_url( get_category_link( $category->term_id ) ), '">', esc_html( $category->cat_name ), '</a>';
endforeach;
?>
</div>
<?php
endif;
/* Meta: Comments */
if ( ( comments_open() || '0' !== get_comments_number() ) ) :
?>
<span class="meta-comments"><i class="fa fa-comment"></i>
<?php
comments_popup_link(
__( '0 Comment', 'blackoot-lite' ),
__( '1 Comment', 'blackoot-lite' ),
__( '% Comments', 'blackoot-lite' ),
'',
__( 'Comments Off', 'blackoot-lite' )
);
?>
</span>
<?php
endif;
/* Meta: Tags */
if ( has_tag() ) :
the_tags( '<div class="meta-tags"><span class="tags-icon"><i class="fa fa-tags"></i></span>', '', '</div>' );
endif;
/* Edit link (only for logged in users allowed to edit post) */
edit_post_link(
__( 'Edit', 'blackoot-lite' ),
'<span class="editlink"><i class="fa fa-pencil"></i>',
'</span>'
);
?>
</div>
<?php
if (
get_post_format()
|| post_password_required()
|| 'content' === get_theme_mod( 'blackoot_blog_index_content' )
) :
?>
<div class="post-content entry-content">
<?php
the_content();
else :
?>
<div class="post-content entry-summary">
<?php
the_excerpt();
endif;
?>
</div>
</div>
<hr />
<?php
endwhile;
else : // If there is no post in the loop
if ( is_search() ) : // Empty search results
?>
<h2><?php esc_html_e( 'Not Found', 'blackoot-lite' ); ?></h2>
<p>
<?php
echo sprintf(
// Translators: %s is the search term
esc_html__( 'Your search for "%s" did not return any result.', 'blackoot-lite' ),
get_search_query()
);
?>
<br />
<?php esc_html_e( 'Would you like to try another search ?', 'blackoot-lite' ); ?>
</p>
<?php
get_search_form();
else : // Empty loop (this should never happen!)
?>
<h2><?php esc_html_e( 'Not Found', 'blackoot-lite' ); ?></h2>
<p><?php esc_html_e( 'What you are looking for isn\'t here...', 'blackoot-lite' ); ?></p>
<?php
endif;
endif;
?>
<div class="page_nav">
<?php
if ( null !== get_next_posts_link() ) :
?>
<div class="previous navbutton"><?php next_posts_link( '<i class="fa fa-angle-double-left"></i>' . __( 'Previous Posts', 'blackoot-lite' ) ); ?></div>
<?php
endif;
if ( null !== get_previous_posts_link() ) :
?>
<div class="next navbutton"><?php previous_posts_link( __( 'Next Posts', 'blackoot-lite' ) . '<i class="fa fa-angle-double-right"></i>' ); ?></div>
<?php
endif;
?>
</div>
</div>
<div id="sidebar-container">
<?php get_sidebar( 'sidebar' ); ?>
</div>
</div>
<?php
get_footer();