Twenty Fourteen: performance win by reducing the number of post thumbnail sizes needed in the theme. Props iamtakashi, closes #25876.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-11-08 05:31:09 +00:00
parent 90b6ccc88d
commit 1b98c32e7a
2 changed files with 6 additions and 10 deletions

View File

@ -13,15 +13,15 @@
<?php
if ( has_post_thumbnail() ) :
if ( 'grid' == get_theme_mod( 'featured_content_layout' ) )
the_post_thumbnail( 'post-thumbnail-grid' );
the_post_thumbnail( 'post-thumbnail' );
else
the_post_thumbnail( 'post-thumbnail-slider' );
the_post_thumbnail( 'post-thumbnail-full-width' );
endif;
?>
</a>
<header class="entry-header">
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) &&twentyfourteen_categorized_blog() ) : ?>
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
<div class="entry-meta">
<span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
</div><!-- .entry-meta -->

View File

@ -64,14 +64,10 @@ function twentyfourteen_setup() {
// Add RSS feed links to <head> for posts and comments.
add_theme_support( 'automatic-feed-links' );
// Enable support for Post Thumbnails.
// Enable support for Post Thumbnails, and declare two sizes.
add_theme_support( 'post-thumbnails' );
// Add several sizes for Post Thumbnails.
add_image_size( 'post-thumbnail-slider', 1038, 576, true );
add_image_size( 'post-thumbnail-full-width', 1038, 0 );
add_image_size( 'post-thumbnail-grid', 672, 372, true );
add_image_size( 'post-thumbnail', 672, 0 );
add_image_size( 'post-thumbnail-full-width', 1038, 576, true );
add_image_size( 'post-thumbnail', 672, 372, true );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(