/
category.php
executable file
·43 lines (37 loc) · 1.14 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
<?php
/**
* The template for displaying Category pages
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Skillcrush_Starter
* @since Skillcrush Starter 1.0
*/
get_header(); ?>
<section class="category-page">
<?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; ?>
<div id="main-content" class="main-content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php else: ?>
<article>
<h4>No posts found!</h4>
</article>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php if ( have_posts() ): ?>
<div id="navigation" class="container">
<div class="left"><?php next_posts_link('← <span>Older Posts</span>'); ?></div>
<div class="right"><?php previous_posts_link('<span>Newer Posts</span> →'); ?></div>
</div>
<?php endif; ?>
</section>
<?php get_footer(); ?>