wp/wp-content/themes/twentyfourteen/category.php
changeset 5 5e2f62d02dcd
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
       
     1 <?php
       
     2 /**
       
     3  * The template for displaying Category pages
       
     4  *
       
     5  * @link https://codex.wordpress.org/Template_Hierarchy
       
     6  *
       
     7  * @package WordPress
       
     8  * @subpackage Twenty_Fourteen
       
     9  * @since Twenty Fourteen 1.0
       
    10  */
       
    11 
       
    12 get_header(); ?>
       
    13 
       
    14 	<section id="primary" class="content-area">
       
    15 		<div id="content" class="site-content" role="main">
       
    16 
       
    17 			<?php if ( have_posts() ) : ?>
       
    18 
       
    19 			<header class="archive-header">
       
    20 				<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentyfourteen' ), single_cat_title( '', false ) ); ?></h1>
       
    21 
       
    22 				<?php
       
    23 					// Show an optional term description.
       
    24 					$term_description = term_description();
       
    25 					if ( ! empty( $term_description ) ) :
       
    26 						printf( '<div class="taxonomy-description">%s</div>', $term_description );
       
    27 					endif;
       
    28 				?>
       
    29 			</header><!-- .archive-header -->
       
    30 
       
    31 			<?php
       
    32 					// Start the Loop.
       
    33 					while ( have_posts() ) : the_post();
       
    34 
       
    35 					/*
       
    36 					 * Include the post format-specific template for the content. If you want to
       
    37 					 * use this in a child theme, then include a file called called content-___.php
       
    38 					 * (where ___ is the post format) and that will be used instead.
       
    39 					 */
       
    40 					get_template_part( 'content', get_post_format() );
       
    41 
       
    42 					endwhile;
       
    43 					// Previous/next page navigation.
       
    44 					twentyfourteen_paging_nav();
       
    45 
       
    46 				else :
       
    47 					// If no content, include the "No posts found" template.
       
    48 					get_template_part( 'content', 'none' );
       
    49 
       
    50 				endif;
       
    51 			?>
       
    52 		</div><!-- #content -->
       
    53 	</section><!-- #primary -->
       
    54 
       
    55 <?php
       
    56 get_sidebar( 'content' );
       
    57 get_sidebar();
       
    58 get_footer();