Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured image: height set is not being inherited correctly on the frontend #42322

Closed
MaggieCabrera opened this issue Jul 11, 2022 · 0 comments · Fixed by #46838
Closed

Featured image: height set is not being inherited correctly on the frontend #42322

MaggieCabrera opened this issue Jul 11, 2022 · 0 comments · Fixed by #46838
Assignees
Labels
[Block] Post Featured Image Affects the Post Featured Image Block [Type] Bug An existing feature does not function as intended

Comments

@MaggieCabrera
Copy link
Contributor

Description

This is a tricky one to find. A featured image block with a set height will show correctly in the editor but the frontend will display something different. There's a couple of reasons to this:

  • the img tag is not getting the height applied to the featured image block wrapper
  • the editor has a different markup than the frontend (the anchor link when the featured image is a link is missing in the editor but present in the frontend)

Step-by-step reproduction instructions

On empty theme, paste this code on a page:

<!-- wp:query {"queryId":33,"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:columns {"backgroundColor":"cyan-bluish-gray"} -->
<div class="wp-block-columns has-cyan-bluish-gray-background-color has-background"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:post-title {"isLink":true,"fontSize":"x-large"} /-->

<!-- wp:post-excerpt {"fontSize":"large"} /--></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:post-featured-image {"isLink":true,"height":"100%","align":"wide"} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:post-template --></div>
<!-- /wp:query -->

Ensure that there's an image on the post you are displaying and the text forces the image to stretch.

Check the frontend, the image is not stretching there.

Screenshots, screen recording, code snippet

Editor:

Screenshot 2022-07-11 at 12 32 46

Frontend:

Screenshot 2022-07-11 at 12 32 35

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended [Feature] Full Site Editing [Block] Post Featured Image Affects the Post Featured Image Block labels Jul 11, 2022
@carolinan carolinan self-assigned this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Featured Image Affects the Post Featured Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants