Make WordPress Core

Changeset 24333


Ignore:
Timestamp:
05/23/2013 05:32:40 PM (13 years ago)
Author:
lancewillett
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/functions.php

    r24151 r24333  
    9696        set_post_thumbnail_size( 604, 270, true );
    9797
    98         // Register custom image size for image post formats.
     98        // Register custom image sizes for image and gallery post formats.
    9999        add_image_size( 'twentythirteen-image-post', 724, 1288 );
     100        add_image_size( 'twentythirteen-gallery-post', 300, 300, true );
    100101
    101102        // This theme uses its own gallery styles.
    … …  
    451452function twentythirteen_gallery_atts( $atts ) {
    452453        if ( has_post_format( 'gallery' ) && ! is_single() )
    453                 $atts['size'] = 'large';
     454                $atts['size'] = wp_is_mobile() ? 'thumbnail' : 'twentythirteen-gallery-post';
    454455
    455456        return $atts;
Note: See TracChangeset for help on using the changeset viewer.