Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#52516 closed defect (bug) (fixed)

Twenty Eleven: Regression, Featured Images no Longer Display in-Post if no Header Size Match

Reported by: macmanx's profile macmanx Owned by: audrasjb's profile audrasjb
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch commit
Focuses: Cc:

Description

In Twenty Eleven, if the featured image matches the header image size, it will be displayed in the header.

If it does not match the header image size, it _used_ to be displayed at the start of the post. This no longer happens. Now, if the featured image does not match the header image size, it is not displayed at all.

I reproduced the issue on two different WordPress 5.6.1 sites with Twenty Eleven 3.6 and no active plugins.

Attachments (2)

52516.patch (2.1 KB) - added by sabernhardt 4 years ago.
minimal approach
52516.featured_image.patch (2.1 KB) - added by sabernhardt 4 years ago.
introducing a new variable for better readability

Download all attachments as: .zip

Change History (17)

#1 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.6.2

#2 @audrasjb
4 years ago

  • Keywords reporter-feedback added

Hi @macmanx and thanks for the report,
I tested the issue on a fresh install of WP 5.6.1 with Twenty Eleven and I wasn't able to reproduce the issue.

Here is a video capture of my testing:
https://i.gyazo.com/ec658cce450dd182bd98e700b3a4e0c9.mp4

Steps:

  • Define a header image in the customizer
  • No featured image for the post: the default header image is displayed for this post
  • Add a featured image that uses the same width (1000px) and height (288px) than the header image: the default header image is replaced with the featured image

Could you please provide some extra information to help to reproduce the issue?

Thanks

Last edited 4 years ago by audrasjb (previous) (diff)

#3 @macmanx
4 years ago

That still works fine @audrasjb this issue about using a featured image which does _not_ match the header size.

If you add a featured image which does _not_ match the header size, the featured image is no longer displayed anywhere in the post. Previously, it would at least be displayed at the start of the post.

#4 @audrasjb
4 years ago

ah sorry I didn't understand the issue! thank you for the explanation :)

#5 @audrasjb
4 years ago

Hmm, here is another test: https://i.gyazo.com/f0239343f2e085a7bf4921570fae5724.mp4

  • No featured image: the default banner image is displayed in the header (as expected)
  • Featured image that is bigger than the header image size: the featured image is displayed in the header (is it expected? AFAIK it's not the behavior you described)

#6 @audrasjb
4 years ago

  • Owner set to audrasjb
  • Status changed from new to assigned

ok I was able to reproduce the issue when using a featured image smaller than the banner image size!

Self-assigning the issue.

#7 @sabernhardt
4 years ago

I also had the same result with WordPress 5.5.3 and Twenty Eleven 3.5.

  • If the featured image is narrower than 1000 pixels, the image does not show (it's an empty link).
  • If wider than 1000 pixels, the image is cropped to 1000 wide.
  • If it's 1000 pixels wide but shorter than 288, that still works.

#8 @audrasjb
4 years ago

I tested WP 5.5.3 and also the previous version of Twenty Eleven and it's still the same. It looks like it is the desired behavior. When did you notice that change @macmanx?

#9 @sabernhardt
4 years ago

  • Keywords needs-patch added; reporter-feedback removed

It happened as early as Twenty Eleven 3.4, after changeset 45581.

The conditional no longer falls back to the default header (or outputs anything) if the featured image width is narrower than the twentyeleven_header_image_width setting.

Twenty Ten's header.php needs a similar fix, too.

Last edited 4 years ago by sabernhardt (previous) (diff)

#10 @SergeyBiryukov
4 years ago

  • Milestone changed from 5.6.2 to 5.7

Moving to 5.7, as this does not appear to be a recent regression, and there are currently no plans to update any of the bundled themes for 5.6.2.

@sabernhardt
4 years ago

minimal approach

@sabernhardt
4 years ago

introducing a new variable for better readability

#11 @sabernhardt
4 years ago

  • Keywords has-patch added; needs-patch removed

Because this is a regression with a short timeframe to fix it, a minimal change like 52516.patch is probably preferable.

If appropriate to change more, however, 52516.featured_image.patch is a bit easier to read and understand.

#12 @audrasjb
4 years ago

  • Keywords commit added

Indeed, I'd suggest to commit 52516.featured_image.patch which tests well on my side.
Thanks @sabernhardt !

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


4 years ago

#14 @SergeyBiryukov
4 years ago

In 50360:

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.

#15 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 50361:

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.

Note: See TracTickets for help on using tickets.