Hi taadike
Can you check if a normal editor gallery block with the same images has the same output.
Hello,
Thanks for your reply.
The normal editor gallery block with the same images doesn’t have the same output. All images are the same size when not using the gallery_format=”editor_block”. Also tried on different themes. Somewhy the Editor Block gallery format makes all rows of images different height. For example, if there are ten images, three images per row, then the first row of images are the biggest (in height), second row are a little shorter in height and third row are the smallest, and the fourth row (10th image) is one big image – full width and full height, covering the entire content area width.
Can they all be same size while still using the gallery_format=”editor_block”?
Edit:
Never mind, I just learned that the Block Gallery is meant to behave like that.
But still one question remains. How to make the captions also hyperlinks? People might click on the captions thinking it is a link as it is overlaid on the image.
-
This reply was modified 3 years, 11 months ago by
taadike.
By the way, I just found another bug. When using the gallery_format=”editor_block”, then somewhy the images are always loaded in full resolution (just scaled down), even though I am using the parameter image_size=”thumbnail”.
How to make it load only thumbnails or medium sized images? There is no point in loading full sized images.
Thanks.
Image sizes don’t work for gallery format editor_block. This is how the Gutenberg editor does it at the moment. See https://github.com/WordPress/gutenberg/issues/1450
Don’t use this format if it’s not working for you. I’m preparing this plugin for a related posts block. I’m just following how the WP gallery block does it at the moment.
Use the link_caption option to link post titles (be aware you might need to style them yourself)
https://keesiemeijer.wordpress.com/related-posts-by-taxonomy/#link-caption
Or for the widget use this filter in your (child) theme’s functions.php file
add_filter( 'related_posts_by_taxonomy_widget_args', 'rpbt_widget_filter', 10, 2 );
function rpbt_widget_filter( $args, $instance ) {
$args['link_caption'] = true;
return $args;
}
btw:
consider creating a child theme instead of editing your theme directly – if you upgrade the theme all your modifications will be lost. Or create a plugin with the code above.