Twenty Fourteen: simplify and prefix post thumbnail sizes, props obenland. See #25946.
git-svn-id: https://develop.svn.wordpress.org/trunk@26152 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
21ed02204d
commit
3345e88fad
@ -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>
|
||||
|
@ -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(
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user