-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Post Featured Image]: Add image size controls #33789
Comments
This looks like a good enhancement for the ImageSizeControl component. |
An additional note on this: the current function (which uses |
@markhowellsmead I try to figure out a way how to use existing filters to make that work. |
There appears to be a little confusion in the code, in as far as there being two thumbnail sizes in the code: The function However, as far as I can see, the image regeneration function |
I've added this to Trac at https://core.trac.wordpress.org/ticket/54383. |
The response in Trac is that the issue was first flagged in https://core.trac.wordpress.org/ticket/17262. Eleven years ago. You might want to find a different solution. |
Oh wow - this is absurd. Thanks for going down the rabbit hole @markhowellsmead @markhowellsmead Would you be open to climb down the rabbit hole together to figure out where to put some tape? I used the |
this might help to set an default image size smaller than It replaces the unset Seems to work for me in the frontend, but not in the editor/backend. |
I don't think it's a brilliant idea to remove the opportunity to use the post thumbnail in this way. (It might make sense for an individual developer to use this, if that's a project requirement.) Replacing
|
For the post-featured-image block, I suggest modifying the call in the
to
|
I'd like to see the full, thumbnail, medium, large, & custom-theme-size(s) selectable to allow for greater flexibility in theme design, especially when the same image may be shown at different sizes throughout a site. |
I'm also keen to see this feature hit production as from a performance point of view not being able to control the size of the featured image is a problem 💚 |
I am assigning this to myself. I will have PR ready shortly. |
It's rather hidden: You have to click on the three dots next to "Dimensions" ("Größe") and select "Image Size". |
@errotu The controls for the Post Featured Image block in the Single template are completely different than in the Archive view. Hardly any of those controls are available and there's no option to choose the image size from the list of preset sizes. |
You can use editor.PostFeaturedImage to append checkboxes and other controls to the featured image block on the post editor. The options can then be used to modify the display of the featured image. I did this with Magazine Plus, which uses some non-standard hooks for displaying posts, but you can also do it with more standard hooks. If all else fails you can use the options to control whether CSS scripts are enqueued which create the outcome you want. This post got me pointed in the right direction. |
This should be opened again. There is still no option to choose a predefined size for single templates. |
It's still available @scrobbleme ;-), it's just called "Resolution" now. |
@vayurobins Yes, but not when editing templates within the site editor. The is no resolution available. |
@scrobbleme, that screenshot is from the Full Site Editor, and I was editing the Archives Template. Using Twenty Twenty Three theme. |
@vayurobins Sorry, it is not working for single templates. "Loops" are fine. I just saw, that there is a new issue for this: #50271 |
If I choose the thumbnail size, then the following HTML is generated.
If I choose the "medium" size, then the following HTML is generated. My medium size is 720px, but the srcset options go up to 1600px. Is this intended behaviour? 🤔
|
yes sure what else did you expect? |
Errr… that the image displayed in the frontend would be the "medium" image size. (It isn't: it's always the "large" image size. And yes, I'm fully aware of how the |
if the viewport is large enough its loading the high resolution image from the srcset. by default your medium image (20160521_DSCF6661-720x480.jpg) |
Nope, it always loads 20160521_DSCF6661-1600x1067.jpg, |
if you expect something different or have more in depth questions to that specific behavior, you should better create a new thread. this one here is about the image size / resolution control in gutenberg. |
Forgive me for misunderstanding: how does adding the block in the single template fix the issue in the post loop? |
thats true. noticed this as well. but as a work around simply copy the featured image block from loop with "resolution" to medium or what ever set and paste it in your single page template. you will notice it now loads the right image size |
@markhowellsmead It doesn't ;) But there are requirements to show a custom resolution ("add_image_size") in a single template as well (i.e. migrating legacy sites to the block editor) |
Not seeing the resolution picker on normal Image block. Oddly enough resolution does show in the [ settings ... ] line drop down menu on the block editor. |
If you are programming your own block-theme you may use the attribute "sizeSlug" to set the custom-image-size "by hand".
|
Folks, if y'all are running into other issues, please open new tickets. The specific issue was addressed. @sinanisler - Custom image sizes do not automatically appear. You have to add those you want to the dropdown via: https://developer.wordpress.org/reference/hooks/image_size_names_choose/ |
The image resolution control for the Post Featured Image Block is still not available on the Single Posts (single.html) view in the Site Editor. Running 6.6.1. |
Yes, why was this skipped for featured images? |
What problem does this address?
We should add image size controls to
Post Featured Image
block (e.g. full, thumbnail, medium, large, custom-theme-size, etc..). Here is @justintadlock 's comment for reference.Initial design from @jasmussen:
The text was updated successfully, but these errors were encountered: