Twenty Fifteen: Use the new archive template tags and make archive template titling way simpler!

Props obenland, fixes #30246.



git-svn-id: https://develop.svn.wordpress.org/trunk@30236 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ian Stewart 2014-11-04 21:00:20 +00:00
parent c8d11a139f
commit 15485e1945
1 changed files with 2 additions and 58 deletions

View File

@ -25,65 +25,9 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title">
<?php
if ( is_category() ) :
single_cat_title();
elseif ( is_tag() ) :
single_tag_title();
elseif ( is_author() ) :
printf( esc_html__( 'Author: %s', 'twentyfifteen' ), '<span class="vcard">' . get_the_author() . '</span>' );
elseif ( is_day() ) :
printf( esc_html__( 'Day: %s', 'twentyfifteen' ), get_the_date() );
elseif ( is_month() ) :
printf( esc_html__( 'Month: %s', 'twentyfifteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyfifteen' ) ) );
elseif ( is_year() ) :
printf( esc_html__( 'Year: %s', 'twentyfifteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentyfifteen' ) ) );
elseif ( is_tax( 'post_format', 'post-format-aside' ) ) :
esc_html_e( 'Asides', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) :
esc_html_e( 'Galleries', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-image' ) ) :
esc_html_e( 'Images', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
esc_html_e( 'Videos', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
esc_html_e( 'Quotes', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
esc_html_e( 'Links', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-status' ) ) :
esc_html_e( 'Statuses', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
esc_html_e( 'Audios', 'twentyfifteen' );
elseif ( is_tax( 'post_format', 'post-format-chat' ) ) :
esc_html_e( 'Chats', 'twentyfifteen' );
else :
esc_html_e( 'Archives', 'twentyfifteen' );
endif;
?>
</h1>
<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header><!-- .page-header -->