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

How to Add Custom Font in WordPress
How to add Custom Font in WordPress.

How to Add Custom Font in WordPress

9th April 2025
Best WordPress Themes for News and Blogs

Best WordPress Themes for News and Blogs

8th April 2025
How to Add PDF/CV Link in WordPress
How to add PDF/CV link in WordPress.

How to Add PDF/CV Link in WordPress

4th April 2025
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