WordPress.org

Make WordPress Core

Ticket #38384: 38384.diff

File 38384.diff, 1.1 KB (added by aaroncampbell, 4 years ago)
  • src/wp-content/themes/twentyseventeen/functions.php

     
    335335function twentyseventeen_content_image_sizes_attr( $sizes, $size ) {
    336336        $width = $size[0];
    337337
    338         740 <= $width && $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';
     338        if ( 740 <= $width ) {
     339                $sizes = '(max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px';
     340        }
    339341
    340342        if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) {
    341                 if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) ) {
    342                         767 <= $width && $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
     343                if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) {
     344                        $sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
    343345                }
    344346        }
    345347