category.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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();