WordPress.org

Make WordPress Core

Changeset 50360


Ignore:
Timestamp:
02/16/2021 07:24:40 PM (7 months ago)
Author:
SergeyBiryukov
Message:

Twenty Eleven: Correct the fallback to the default header if the featured image width is narrower than the twentyeleven_header_image_width setting.

Follow-up to [45581].

Props sabernhardt, macmanx, audrasjb.
See #52516.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/header.php

    r48290 r50360  
    104104                 * Check if this is a post or page, if it has a thumbnail, and if it's a big one
    105105                 */
     106                $image = false;
    106107                if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
    107108                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
    108                     if ( $image && $image[1] >= $header_image_width ) {
    109                         // Houston, we have a new header image!
    110                         echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    111                     }
     109                }
     110                if ( $image && $image[1] >= $header_image_width ) {
     111                    // Houston, we have a new header image!
     112                    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    112113                } else {
    113114                    // Compatibility with versions of WordPress prior to 3.4.
Note: See TracChangeset for help on using the changeset viewer.