-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory.php
44 lines (38 loc) · 1.15 KB
/
category.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
<?php
/**
* The template for displaying Category pages
*
* @package WordPress
* @subpackage Skillcrush_Starter
* @since Skillcrush Starter 2.0
*/
get_header(); ?>
<?php if ( have_posts() ): ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Posts categorized as <span>%s</span>', 'skillcrushstarter' ), single_cat_title( '', false ) ); ?></h1>
</header>
<?php endif; ?>
<section class="category-page">
<div class="main-content">
<?php if ( have_posts() ): ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content-blog', get_post_format() ); ?>
<?php endwhile; ?>
<?php else: ?>
<article>
<h4>No posts found!</h4>
</article>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</section>
<nav id="navigation" class="container">
<div class="left"><?php next_posts_link('← <span>Older Posts</span>'); ?></div>
<div class="pagination">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
echo 'Page '.$paged.' of '.$wp_query->max_num_pages;
?>
</div>
<div class="right"><?php previous_posts_link('<span>Newer Posts</span> →'); ?></div>
</nav>
<?php get_footer(); ?>