-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-posts-index.php
42 lines (41 loc) · 1.19 KB
/
template-posts-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
<?php //Template Name:Posts index
$category_name = get_post()->post_name;
$cat = get_category_by_slug($category_name);
if ($cat === False) {
header('Location: ' . get_site_url());
exit;
}
get_header();
wp_enqueue_style('stt-styles');
wp_enqueue_style('columns');
print_page_title();
echo get_page_top_spacer(); ?>
<div class="content-wrapper body-wrapper blog-post blog-span container extra"> <?php
add_page_path(); ?>
<div class="space-sep20"></div>
<div class="row">
<div class="col-md-12 col-sm-12 col-extra style-white center"><?php
echo '<h1>' . $cat->name . '</h1>';
$cat_description = category_description($cat->term_id);
if (!empty($cat_description)) {
echo $cat_description;
} ?>
</div>
</div><?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
echo do_post_list_shortcode(array(
'category' => $category_name,
'count' => 10,
'paged' => $paged,
'details' => true,
)); ?>
<div class="pagination"><?php
if (get_next_posts_link()) {
next_posts_link(__('← Older posts', 'stt'));
}
if (get_previous_posts_link()) {
previous_posts_link(__('Newer posts →', 'stt'));
} ?>
</div>
</div>
<?php get_footer(); ?>