WordPress.org

Make WordPress Core

Changeset 50361


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

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

Follow-up to [45581].

Props sabernhardt, macmanx, audrasjb.
Fixes #52516.

File:
1 edited

Legend:

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

    r48290 r50361  
    8888
    8989                // Check if this is a post or page, if it has a thumbnail, and if it's a big one.
     90                $image = false;
    9091                if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
    9192                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
    92                     if ( $image && $image[1] >= $header_image_width ) {
    93                         // Houston, we have a new header image!
    94                         echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    95                     }
     93                }
     94                if ( $image && $image[1] >= $header_image_width ) {
     95                    // Houston, we have a new header image!
     96                    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    9697                } else {
    9798                    // Compatibility with versions of WordPress prior to 3.4.
Note: See TracChangeset for help on using the changeset viewer.