-
thorsolutions
When I add a GB image block inside a GB Query Block, the custom image sizes are not available.
This happens when using featured images or an ACF image field (tried all the outputs: Image Array, Image URL and Image ID).When I edit the dynamic tag for the image, I have an option to pick the image size:

But after I insert the dynamic tag, the image sizes are no longer available:

As a result of this, the images on the frontend have the full image size, instead of the size I want to use.
I’m 100% sure I have all the custom sizes for all the images. I regenerated the image sizes a thousand times by now. :/
Am I doing something wrong?
-
Hi there,
The image size in the dynamic tag settings should work.
Can you show me the image in question on your site? What size did you choose in the dynamic tag setting?
-
thorsolutions
Hi there Ying. Thanks for the quick reply.
I’ve tried with all the image sizes available. I’ve also created a couple custom image sizes in functions.php:
add_image_size( 'company-thumbnail', 290, 290, true ); add_image_size( 'team-member-thumbnail', 180, 180, true ); add_filter( 'image_size_names_choose', function( $sizes ) { return array_merge( $sizes, [ 'company-thumbnail' => __( 'Company Thumbnail', 'grow' ), 'team-member-thumbnail' => __( 'Team Member Thumbnail', 'grow' ), ] ); } );All my images have those custom image sizes, as you can see in this screenshot:

One thing I’ve noticed is that if you insert a GB image block outside a Query block, it won’t have any image sizes available as well, until you select an image. It needs the image to check for the sizes.
Maybe this is a problem inside a Query block, because the images are dynamic.
Just guessing. :/ -
thorsolutions
I’ve done some more tests, installed WordPress and GenerateBlocks Pro in different servers and environments, and always got the same result.
Apparently, this behaviour is normal with images inside the Query blocks. I suspect, since the images are dynamic, the Image block can’t show the image sizes dropdown.
However, the image size I pick in the dynamic tag dialog is saved in the dynamic tag, like this:
{{featured_image size:company-thumbnail|key:url}}This is fine, but it raises another problem. In the frontend, some images load with the company-thumbnail custom image size, but other images in the same loop load with different sizes. After a lot of back and forth with Claude and DeepSeek, it looks like this problem is related with scrset and the way WordPress handles the image sizes.
If I disable scrset with the following filter, all images load with the right size.
add_filter( 'wp_calculate_image_srcset', '__return_false' );At this point I’m not even sure there’s still a problem. I can set the image sizes in the dynamic tag dialog. The images don’t display at that size exactly, but I think that’s related to the way WordPress handles the scrset.
-
Yes, you are right, WP handles the scrset, GB outputs a width and height for the image, and the browser will pick the image size based on scrset and the size attributes.
- You must be logged in to reply to this topic.