Twenty Fourteen: simplify and prefix post thumbnail sizes, props obenland. See #25946.

Built from https://develop.svn.wordpress.org/trunk@26152


git-svn-id: http://core.svn.wordpress.org/trunk@26063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-11-14 04:50:11 +00:00
parent 85dcc4aea8
commit c8cfe17a02
4 changed files with 9 additions and 9 deletions

View File

@ -13,9 +13,9 @@
<?php
if ( has_post_thumbnail() ) :
if ( 'grid' == get_theme_mod( 'featured_content_layout' ) )
the_post_thumbnail( 'post-thumbnail' );
the_post_thumbnail();
else
the_post_thumbnail( 'post-thumbnail-full-width' );
the_post_thumbnail( 'twentyfourteen-full-width' );
endif;
?>
</a>

View File

@ -66,8 +66,8 @@ function twentyfourteen_setup() {
// Enable support for Post Thumbnails, and declare two sizes.
add_theme_support( 'post-thumbnails' );
add_image_size( 'post-thumbnail-full-width', 1038, 576, true );
add_image_size( 'post-thumbnail', 672, 372, true );
set_post_thumbnail_size( 672, 372, true );
add_image_size( 'twentyfourteen-full-width', 1038, 576, true );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(

View File

@ -174,9 +174,9 @@ function twentyfourteen_post_thumbnail() {
<div class="post-thumbnail">
<?php
if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) && ! wp_is_mobile() )
the_post_thumbnail( 'post-thumbnail-full-width' );
the_post_thumbnail( 'twentyfourteen-full-width' );
else
the_post_thumbnail( 'post-thumbnail' );
the_post_thumbnail();
?>
</div>
@ -185,9 +185,9 @@ function twentyfourteen_post_thumbnail() {
<a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
<?php
if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) ) && ! wp_is_mobile() )
the_post_thumbnail( 'post-thumbnail-full-width' );
the_post_thumbnail( 'twentyfourteen-full-width' );
else
the_post_thumbnail( 'post-thumbnail' );
the_post_thumbnail();
?>
</a>

View File

@ -158,7 +158,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
$total_images = count( $images );
if ( has_post_thumbnail() ) :
$post_thumbnail = get_the_post_thumbnail( get_the_ID(), 'post-thumbnail' );
$post_thumbnail = get_the_post_thumbnail();
elseif ( $total_images > 0 ) :
$image = array_shift( $images );
$post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );