wp/wp-content/themes/twentyfourteen/taxonomy-post_format.php
changeset 8 c7c34916027a
parent 7 cf61fcea0001
child 9 177826044cd9
equal deleted inserted replaced
7:cf61fcea0001 8:c7c34916027a
     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 
       
    19 get_header(); ?>
       
    20 
       
    21 	<section id="primary" class="content-area">
       
    22 		<div id="content" class="site-content" role="main">
       
    23 
       
    24 			<?php if ( have_posts() ) : ?>
       
    25 
       
    26 			<header class="archive-header">
       
    27 				<h1 class="archive-title">
       
    28 					<?php
       
    29 					if ( is_tax( 'post_format', 'post-format-aside' ) ) :
       
    30 						_e( 'Asides', 'twentyfourteen' );
       
    31 
       
    32 						elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
       
    33 							_e( 'Images', 'twentyfourteen' );
       
    34 
       
    35 						elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
       
    36 							_e( 'Videos', 'twentyfourteen' );
       
    37 
       
    38 						elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
       
    39 							_e( 'Audio', 'twentyfourteen' );
       
    40 
       
    41 						elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
       
    42 							_e( 'Quotes', 'twentyfourteen' );
       
    43 
       
    44 						elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
       
    45 							_e( 'Links', 'twentyfourteen' );
       
    46 
       
    47 						elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
       
    48 							_e( 'Galleries', 'twentyfourteen' );
       
    49 
       
    50 						else :
       
    51 							_e( 'Archives', 'twentyfourteen' );
       
    52 
       
    53 						endif;
       
    54 					?>
       
    55 				</h1>
       
    56 			</header><!-- .archive-header -->
       
    57 
       
    58 			<?php
       
    59 					// Start the Loop.
       
    60 			while ( have_posts() ) :
       
    61 				the_post();
       
    62 
       
    63 				/*
       
    64 				 * Include the post format-specific template for the content. If you want to
       
    65 				 * use this in a child theme, then include a file called content-___.php
       
    66 				 * (where ___ is the post format) and that will be used instead.
       
    67 				 */
       
    68 				get_template_part( 'content', get_post_format() );
       
    69 
       
    70 					endwhile;
       
    71 					// Previous/next page navigation.
       
    72 					twentyfourteen_paging_nav();
       
    73 
       
    74 				else :
       
    75 					// If no content, include the "No posts found" template.
       
    76 					get_template_part( 'content', 'none' );
       
    77 
       
    78 				endif;
       
    79 			?>
       
    80 		</div><!-- #content -->
       
    81 	</section><!-- #primary -->
       
    82 
       
    83 <?php
       
    84 get_sidebar( 'content' );
       
    85 get_sidebar();
       
    86 get_footer();