tag.php 1.6 KB

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