Make WordPress Core

Ticket #38848: 38848.diff

File 38848.diff, 1020 bytes (added by helen, 8 years ago)
  • src/wp-content/themes/twentyseventeen/template-parts/page/content-front-page-panels.php

     
    1717        <?php if ( has_post_thumbnail() ) :
    1818                $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
    1919
    20                 $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
    21 
    22                 $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' );
    23 
    2420                // Calculate aspect ratio: h / w * 100%.
    25                 $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100;
     21                $ratio = $thumbnail[2] / $thumbnail[1] * 100;
    2622                ?>
    2723
    2824                <div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);">