Site logo

[Resolved] Query loop post template: image size

Home Forums Support [Resolved] Query loop post template: image size

Home Forums Support Query loop post template: image size

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1916262
    dmendana

    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!

    #1916545
    David
    Staff
    Customer Support

    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.

    #1916743
    dmendana

    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!

    #1916766
    David
    Staff
    Customer Support

    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.

    #1916838
    dmendana

    That worked!

    Thank you very much.

    #1916841
    David
    Staff
    Customer Support

    Awesome – glad to hear that!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.