Archived topic
Query loop post template: image size
5 replies · Started by dmendana on September 2, 2021
Hi! I'm experimenting with the new Query block in WP 5.8 and the main problem I'm finding is the lack of options to choose a size and aspect ratio for the post thumbnail. The block is using the full size image for the thumbnails, so all thumbnails are wildly different and a grid is impossible.
According to what I've read, in this early stage of the Query block we are stuck with the theme's thumbnail size.
Is there any option in Generatepress that would change the featured image size in a Query block? I've changed the option in Customizer > Layout > Blog > Featured Images > Media Attachment Size, but it didn't change anything in the Query block. I've also looked at Settings > Media, but there's nothing useful there.
Thanks!
Hi there,
to be honest, i played with the Query Loop block and the other template blocks, and well, it wasn't long before i dropped the idea of using them anywhere lol - they're a great idea but very half baked at this time.
Was there a particular post you could link me to that references the 'themes thumbnail size' ? Might give me some pointers.
Hi! I read it here, it's not a technical article.
However, the Post Featured Image block does not currently have sizing controls, so you are stuck with your theme’s default post-thumbnail size — assuming it is actually registered.
I have managed to change the visible size of the image with CSS, but not the image file being used, still the original. If there's no way to change that, I'll probably search for a plugin to embed a post grid block.
Thanks!
Ah ok ... so the Theme doesn't set on, so you should be able to use a PHP Snippet like so:
function wpdocs_setup_theme() {
set_post_thumbnail_size( 150, 150 );
}
add_action( 'after_setup_theme', 'wpdocs_setup_theme' );
Reference: https://developer.wordpress.org/reference/functions/set_post_thumbnail_size/
I would test it on a dev site, as i am not sure if that will interfere with any other functions.
That worked!
Thank you very much.
Awesome - glad to hear that!