Since Wordpress 5.x they've removed the thumbnail size option for galleries. Is there a way to activate or build a workaround? I like to build up a classic Lightbox gallery.
Since Wordpress 5.x they've removed the thumbnail size option for galleries. Is there a way to activate or build a workaround? I like to build up a classic Lightbox gallery.
There is a project going on about the image sizes. You can follow it right here.
Right now, you can try using shortcode_atts_gallery filter. Take a look at these codes to get a hint:
/* Register shortcode_atts_gallery filter callback */
add_filter( 'shortcode_atts_gallery', 'meks_gallery_atts', 10, 3 );
/* Change attributes of wp gallery to modify image sizes for your needs */
function meks_gallery_atts( $output, $pairs, $atts ) {
/* You can use these sizes:
- thumbnail
- medium
- large
- full
or, if your theme/plugin generate additional custom sizes you can use them as well
*/
$output['size'] = 'medium'; //i.e. This will change all your gallery images to "medium" size
return $output;
}
You can find more information about shortcode_atts_gallery right here.
It's an ongoing process. Right now there is not a way to adjust manually the image sizes on the gallery block. It is being discussed by the WordPress core development community on this github issue.
Just because the default gutenberg gallery block does not allow you to do it does not mean you cannot install a 3rd party plugin, create a custom block yourself (I recommend using ACF Custom Blocks), or reverting to the classic editor for this specific use.