By Basharat Ali Khan | Last updated: October 25, 2026
WordPress gallery not displaying correctly usually shows up in a few recognizable ways. You set a gallery to three images per row, but you get one column. Images appear at uneven sizes in the same row. Or the gallery looks perfect in the editor and broken on the live site. The cause is usually a settings issue, mismatched source images, a theme or plugin CSS conflict, or a cache.
This guide goes through the causes in the order I would check them.
Quick Answer
WordPress gallery not displaying correctly is most often caused by gallery settings (columns, crop and image size), uneven source images, or theme CSS overriding the gallery layout. Check the block’s settings first, then test with a default theme to find a CSS conflict. If it looks fine in the editor but not live, clear every cache and check for plugins that delay JavaScript.
First, Identify the Symptom
- All images stacked in one column: usually a settings, responsive or CSS issue (Fixes 1, 2 and 4).
- Images at uneven sizes in one row: usually source image sizes or crop settings (Fixes 1 and 3).
- Fine in the editor, broken on the live site: cache, theme or plugin differences (Fixes 5, 6 and 8).
- Lightbox or masonry layout not working: usually a plugin or JavaScript problem (Fix 6).
- Cropped oddly after a theme change: missing thumbnail sizes (Fix 8).
Fix 1: Check the Gallery Block Settings
WordPress gallery not displaying correctly is sometimes just a setting. Click the gallery in the editor and check the block’s sidebar:
- Columns: set the number you actually want.
- Crop images: turn this on so all images in a row share the same shape and height.
- Image size: choose a size such as Large or Medium instead of Full Size, which uses each original image as it is.
Update the page and check the live site.
Fix 2: Check Whether It Is Only a Mobile Behavior
Gallery layouts reduce the number of columns on narrow screens by design, so a gallery that shows three columns on desktop may show fewer on a phone. Before you treat this as broken, check whether the problem appears only on mobile, and compare with how other blocks behave on the same screen.
If you use Elementor, check the widget’s column setting for each device (desktop, tablet and mobile) in the widget options.
Fix 3: Make Your Source Images Consistent
If images look uneven, the uploaded files may have very different sizes or aspect ratios. A tall portrait photo next to a wide landscape one creates uneven rows, even with good CSS.
- Crop or resize images to similar dimensions before uploading, for the cleanest result.
- Use the Crop images option (Fix 1) so the gallery crops them for you.
- Avoid “Full Size” unless your originals are already uniform.
Fix 4: Find and Fix a CSS Conflict
If the settings are right, your theme’s or custom CSS may be overriding the gallery layout. You can find the cause in two minutes with your browser:
- Right-click the gallery on the live site and choose Inspect.
- Look for the gallery container, usually with the class
wp-block-gallery. - Check which CSS rules affect it. A rule that changes
display,widthorflexon the gallery or its images is a likely culprit. It may come from your theme or from your own Additional CSS.
As a test, you can add this small, gallery-only rule under Appearance > Customize > Additional CSS:
.wp-block-gallery.has-nested-images {
display: flex;
flex-wrap: wrap;
}
This targets only gallery blocks, so it will not affect your buttons, columns or menus. If it makes no difference, remove it. Avoid copying broad rules aimed at classes such as.is-layout-flex, because WordPress uses those for many other blocks, and changing them can break your site layout.
Fix 5: Test With a Default Theme
If the CSS check does not reveal the cause, temporarily switch to a default theme such as Twenty Twenty-Four.
- Check whether the gallery displays correctly there.
- If it does, the problem is in your active theme. Check its documentation or support forum for a gallery fix, since this is common enough that many theme developers have documented it.
- Switch back to your theme afterwards.
Do this on a staging site if your live site is busy.
Fix 6: Rule Out a Plugin Conflict
Plugins can interfere with galleries, especially page builders, image optimizers and gallery or lightbox plugins.
- Deactivate plugins one at a time, starting with image and gallery plugins.
- Check the gallery after each one.
- When it works, check that plugin’s settings for a relevant option.
One common culprit is the delay JavaScript or defer scripts option in optimization plugins. It can break lightbox, slider and masonry galleries, because the scripts they need load too late. Add the gallery’s script to the plugin’s exclusion list, then clear your cache. Lazy loading can also hide gallery images that load below the fold, so check its exclusion settings.
Fix 7: Check Your Page Builder’s Gallery Widget
If the gallery was built with Elementor or another builder, its settings override the block settings above.
- In Elementor, check the gallery widget’s Columns, Image Size and Layout (such as Grid, Justified or Masonry) options.
- Check the responsive options for tablet and mobile separately.
- Make sure the widget is not set to a fixed height that crops the images.
Fix 8: Clear Caches and Regenerate Thumbnails
If you applied a fix but the live site looks the same, a cache may be serving an old page. Clear your caching plugin’s cache and your CDN cache, then test in an incognito window.
If you recently changed themes and gallery images now look cropped or sized wrongly, your new theme probably uses different thumbnail dimensions. A plugin such as Regenerate Thumbnails can rebuild all image sizes to match your current theme. If new images will not upload at all, see my guide on WordPress images not uploading.
Quick Reference Table of WordPress gallery not displaying correctly
If WordPress gallery not displaying correctly still leaves you unsure where to start, match your symptom here.
| Symptom | Likely cause | Fix |
|---|---|---|
| Images stacked in one column | Settings, responsive behavior or CSS | Fixes 1, 2 and 4 |
| Only broken on a phone | Columns reduced by design, or a mobile setting | Fix 2 |
| Uneven image sizes in one row | Source images or crop setting | Fixes 1 and 3 |
| Broken only with your active theme | Theme CSS conflict | Fixes 4 and 5 |
| Lightbox or masonry not working | Plugin or delayed JavaScript | Fix 6 |
| Built with Elementor | Widget settings | Fix 7 |
| Fine in the editor, broken live | Cache or plugin difference | Fixes 6 and 8 |
| Cropped oddly after a theme change | Thumbnail sizes | Fix 8 |
Frequently Asked Questions for WordPress gallery not displaying correctly
Why did my gallery suddenly break with no changes on my end?
A WordPress core update, a theme update or an optimization plugin setting can change gallery CSS or scripts. Check the CSS conflict steps in Fix 4 and the plugin steps in Fix 6.
Is it safe to add CSS in the Customizer for this?
Yes. Additional CSS is stored separately from your theme files, so theme updates do not remove it. Keep your rule specific to galleries, and test it on a staging site if you can.
Will resizing my images fix galleries that are already published?
Not automatically. You would need to re-upload resized versions, or use a thumbnail regeneration tool to rebuild the sizes WordPress uses.
Is it a WordPress bug or a theme problem?
Either is possible. WordPress updates can change block layout CSS, and themes that have not adapted can conflict with it, which is why some sites break and others do not after the same update.
Why does my gallery look fine in the editor but not live?
The editor and the live site can load different CSS, and the live site may also be cached. Check the theme’s front-end CSS, clear your cache and test in an incognito window.
Do I need a developer to fix this?
Usually not. Most cases are fixed in the block settings, image sizes or plugin exclusions. A developer helps with custom CSS conflicts or theme templates.
Need Help Fixing Your Gallery?
If your galleries are still misbehaving after these steps, contact me here and I will fix it directly, or see my WordPress services.
About the author
Basharat Ali Khan is a WordPress developer in Gilgit, Pakistan with 8+ years of experience building custom plugins, Elementor sites and WooCommerce stores.
LinkedIn | WordPress.org profile
Related: WordPress Featured Image Not Showing | WordPress Images Not Uploading | WordPress Custom Logo Not Showing
