Add featured images to Latest Posts block#17151
Add featured images to Latest Posts block#17151jorgefilipecosta merged 10 commits intoWordPress:masterfrom
Conversation
|
Thanks for working on this Kelly! Similar to: #16448 |
|
Hi @ryelle |
|
Hello! I could really use this feature for an upcoming project and would love to help take it over the line. I'm not familiar with the WP codebase but it looks like there is a panel in the Wordpress admin panel that allows you to modify the image dimensions for the base dimensions (thumbnail, small, medium, etc) so we should be able to pull those values from a config somewhere. |
|
Hey Steven @stevenbuccini If you need another option then you can take a look at https://wordpress.org/plugins/post-type-archive-mapping/ I use it on a lot of sites. The Gutenberg core Latest Posts Block is still missing a lot of useful features before I can consider using it. If your able to figure out a way to add the featured image to the block that would be very helpful. Either by taking over this PR or adding a new PR. |
There was a problem hiding this comment.
We didn't figure out yet a good place for all these block specific components, I don't think "components" is the best place for it as it's more the design system, maybe in block-editor module. We could consider making it priivate as a start in the block-library package.
There was a problem hiding this comment.
Yeah, there was discussion here #17148 about where this component should live, but it didn't really come to a conclusion. block-editor works for me, so I can move that PR ahead which can then move this one out of draft status :)
|
Hey @ryelle and @youknowriad, any further progress on this PR? |
|
Just noting that for WordCamp Europe we are using this block and would love to have the featured images working. Be great to test it out there too. |
d929be2 to
a2acabe
Compare
|
Looking forward to this! Thanks for working on it everyone. Hope to see it live soon. |
a2acabe to
c785f73
Compare
|
Yep, I just added this to the WP 5.4 project board. Do you think this is possible, @ryelle? |
|
@mapk Great! I worked on this yesterday & got it to a reviewable state, so I moved it over to the "Needs Review" column on the board. |
There was a problem hiding this comment.
We should do that before landing this PR.
There was a problem hiding this comment.
It's been long enough since I worked on this that I didn't realize this was left in 🤦♀
There was a problem hiding this comment.
I've added the real functionality here, but it required adding a new setting imageDimensions to get the mapping of size name to height & width. I also had to pull "full" out of the available options, since we can't actually get a default height & width of all full size images. Maybe a future iteration of this (or of ImageSizeControl) could handle this case.
|
Everything looks good to me now.
@jorgefilipecosta @youknowriad Any reservations with adding a new block
editor setting for image dimensions?
|
100b40e to
ca3805b
Compare
|
The required core changes are being done in https://core.trac.wordpress.org/attachment/ticket/49389/. |
ca3805b to
7a69fe9
Compare
|
Yahhh! It has been merged..:) |
| height: auto; | ||
| width: auto; | ||
| } | ||
| &.alignleft { |
There was a problem hiding this comment.
The alignleft and alignright classes are intended to be used with CSS float styles (and they probably shouldn't be called alignleft and alignright, but that's a whole other topic). This class style override is inconsistent with the usage of the class name elsewhere.
|
So happy to see this in! 🎉 Thanks everyone! |
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. git-svn-id: https://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. git-svn-id: https://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. Built from https://develop.svn.wordpress.org/trunk@47240 git-svn-id: http://core.svn.wordpress.org/trunk@47040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. Built from https://develop.svn.wordpress.org/trunk@47240 git-svn-id: https://core.svn.wordpress.org/trunk@47040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. Built from https://develop.svn.wordpress.org/trunk@47240
This commit includes in the core settings for the gradients theme API stabilized in WordPress/gutenberg#20107, and for the image sizes required for the latest posts feature image WordPress/gutenberg#17151. Props: youknowriad, ryelle. Fixes #49389. git-svn-id: http://develop.svn.wordpress.org/trunk@47240 602fd350-edb4-49c9-b593-d223f7449a82
|
@ryelle, @jorgefilipecosta: the introduction of The Gutenberg plugin requires WordPress 5.2.0+. We should either bump that to 5.3.0, or guard against missing |
|
Reported in #20484. |
Description
See #1594. This PR builds on #17148 to add featured image to the Latest Posts block. It uses that new
ImageSizeControlcontrol and adds an alignment control for image alignment.Screenshots
Editor
Sidebar
Front end
Still To Do
imageHeight&imageWidth, which function as a basis for the resizing. For a single image, this is literally the width & height of that particular image. For this block, we can use the site defaults for each image size? — This seems to work just fine ✅To Test