-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategory.php
More file actions
executable file
·63 lines (57 loc) · 1.5 KB
/
Copy pathcategory.php
File metadata and controls
executable file
·63 lines (57 loc) · 1.5 KB
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
<?php
/*
Template Name: Category
*/
get_header();
?>
<main id="main">
<div class="main-content">
<?php
$categories = get_the_category();
$category = $categories[0];
?>
<div class="boxed-aqua">
<h1><?php echo $category->cat_name; ?></h1>
<p><?php echo $category->description; ?></p>
</div>
<?php
if (have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<article id="<?php the_ID(); ?>" <?php post_class(['boxed']); ?>>
<?php get_template_part('templates/excerpt', 'category'); ?>
</article>
<?php if (is_single() ) : ?>
<section class="comments">
<?php comments_template(); ?>
</section>
<?php endif; ?>
<?php
endwhile;
$pagination_links = '';
if (get_previous_posts_link() ) {
$pagination_links .= get_previous_posts_link();
}
if (get_next_posts_link() ) {
if ($pagination_links ) {
$pagination_links .= ' — ';
}
$pagination_links .= get_next_posts_link();
}
echo $pagination_links;
else :
?>
<article class="boxed">
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>
</article>
<?php
endif;
?>
</div>
</main>
<?php
get_footer();
?>