category.php 1.6 KB

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