taxonomy-post_format.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * The template for displaying Post Format pages
  4. *
  5. * Used to display archive-type pages for posts with a post format.
  6. * If you'd like to further customize these Post Format views, you may create a
  7. * new template file for each specific one.
  8. *
  9. * @todo https://core.trac.wordpress.org/ticket/23257: Add plural versions of Post Format strings
  10. * and remove plurals below.
  11. *
  12. * @link https://codex.wordpress.org/Template_Hierarchy
  13. *
  14. * @package WordPress
  15. * @subpackage Twenty_Fourteen
  16. * @since Twenty Fourteen 1.0
  17. */
  18. get_header(); ?>
  19. <section id="primary" class="content-area">
  20. <div id="content" class="site-content" role="main">
  21. <?php if ( have_posts() ) : ?>
  22. <header class="archive-header">
  23. <h1 class="archive-title">
  24. <?php
  25. if ( is_tax( 'post_format', 'post-format-aside' ) ) :
  26. _e( 'Asides', 'twentyfourteen' );
  27. elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
  28. _e( 'Images', 'twentyfourteen' );
  29. elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
  30. _e( 'Videos', 'twentyfourteen' );
  31. elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
  32. _e( 'Audio', 'twentyfourteen' );
  33. elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
  34. _e( 'Quotes', 'twentyfourteen' );
  35. elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
  36. _e( 'Links', 'twentyfourteen' );
  37. elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
  38. _e( 'Galleries', 'twentyfourteen' );
  39. else :
  40. _e( 'Archives', 'twentyfourteen' );
  41. endif;
  42. ?>
  43. </h1>
  44. </header><!-- .archive-header -->
  45. <?php
  46. // Start the Loop.
  47. while ( have_posts() ) : the_post();
  48. /*
  49. * Include the post format-specific template for the content. If you want to
  50. * use this in a child theme, then include a file called called content-___.php
  51. * (where ___ is the post format) and that will be used instead.
  52. */
  53. get_template_part( 'content', get_post_format() );
  54. endwhile;
  55. // Previous/next page navigation.
  56. twentyfourteen_paging_nav();
  57. else :
  58. // If no content, include the "No posts found" template.
  59. get_template_part( 'content', 'none' );
  60. endif;
  61. ?>
  62. </div><!-- #content -->
  63. </section><!-- #primary -->
  64. <?php
  65. get_sidebar( 'content' );
  66. get_sidebar();
  67. get_footer();