Last image in WordPress gallery is too wide

Summary

Since you are here, you probably don’t like the last image being full width in the Gutenberg gallery either. Just why is it all over the place. I personally hate it.

There are two options

  1. Hack it – just add simple CSS code
  2. Use different Gallery

1. Adding the code:

Thankfully, it’s super easy, all you have to do is to add this code to your custom CSS. So, in the Customizer, just add this:

.wp-block-gallery.has-nested-images figure.wp-block-image {
flex-grow:0;
}

A video tutorial how to add custom CSS code.

2. Use different Gallery

If you are using the Minimalio free theme with the Premium plugin, there is a Minimalio gallery block for you. It also comes with more options than the default WP gallery, that are super useful. Here is a tutorial how to add the gallery.

If you are not using Minimalio, you can check out these gallery plugins, that I have tested. But honestly, it’s kind of a disaster when it comes to gallery plugins.

Good luck!

25th February 2025

Creator of Minimalio theme.

Latest

Best WordPress Multipurpose Themes

Best WordPress Multipurpose Themes

31st March 2025
Best Brutalist WordPress Themes
Best brutalist WordPress themes.

Best Brutalist WordPress Themes

27th March 2025
How to Create an Anchor Link
How to Create an Anchor Link.

How to Create an Anchor Link

25th March 2025
Minimalist WordPress Blog Themes
Minimalist WordPress blog themes.

Minimalist WordPress Blog Themes

24th March 2025
How to Optimize images for WordPress
How to optimize images for WordPress.

How to Optimize images for WordPress

20th March 2025
Blank space in WordPress and Gutenberg
How to add blank space in WordPress.

Blank space in WordPress and Gutenberg

13th March 2025