Twenty Thirteen: create new image size for galleries, at 300 x 300 so that "large" image size doesn't load for a resulting thumbnail on index views. See #24307.
git-svn-id: http://core.svn.wordpress.org/trunk@24333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1657a226a1
commit
81b18ddade
|
@ -95,8 +95,9 @@ function twentythirteen_setup() {
|
||||||
add_theme_support( 'post-thumbnails' );
|
add_theme_support( 'post-thumbnails' );
|
||||||
set_post_thumbnail_size( 604, 270, true );
|
set_post_thumbnail_size( 604, 270, true );
|
||||||
|
|
||||||
// Register custom image size for image post formats.
|
// Register custom image sizes for image and gallery post formats.
|
||||||
add_image_size( 'twentythirteen-image-post', 724, 1288 );
|
add_image_size( 'twentythirteen-image-post', 724, 1288 );
|
||||||
|
add_image_size( 'twentythirteen-gallery-post', 300, 300, true );
|
||||||
|
|
||||||
// This theme uses its own gallery styles.
|
// This theme uses its own gallery styles.
|
||||||
add_filter( 'use_default_gallery_style', '__return_false' );
|
add_filter( 'use_default_gallery_style', '__return_false' );
|
||||||
|
@ -450,7 +451,7 @@ function twentythirteen_get_link_url() {
|
||||||
*/
|
*/
|
||||||
function twentythirteen_gallery_atts( $atts ) {
|
function twentythirteen_gallery_atts( $atts ) {
|
||||||
if ( has_post_format( 'gallery' ) && ! is_single() )
|
if ( has_post_format( 'gallery' ) && ! is_single() )
|
||||||
$atts['size'] = 'large';
|
$atts['size'] = wp_is_mobile() ? 'thumbnail' : 'twentythirteen-gallery-post';
|
||||||
|
|
||||||
return $atts;
|
return $atts;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue