Troubleshooting Gallery and Column Display Issues in Twenty Twenty-One
Content
Many users of the Twenty Twenty-One theme report issues where galleries and column layouts appear correctly in the WordPress editor but break on the live site. This common problem can be frustrating, but it's often solvable with a few targeted fixes. This guide covers the most frequent causes and their solutions.
Common Symptoms
Based on community reports, the issues typically manifest as:
- Galleries set to display in 4 columns only showing 3, with one image appearing much larger.
- Gutenberg Columns blocks stacking vertically instead of appearing side-by-side on the front end.
- Image distortion or unexpected white space within column and gallery layouts.
Why This Happens
These display discrepancies are rarely due to a single cause. The most common culprits are:
- Plugin Conflicts: Third-party plugins, especially page builders like Elementor, can override the theme's native styles for blocks.
- Browser-Specific CSS: Some CSS properties may render differently in certain browsers, particularly older versions (e.g., Safari on outdated iOS).
- Custom CSS: Previously added custom CSS might conflict with new theme or WordPress core updates.
- Theme Updates: Major WordPress updates (like version 6.0) can sometimes change how core blocks are handled, requiring theme adjustments.
How to Troubleshoot and Fix
1. Conduct a Basic Conflict Check
The first step is always to rule out conflicts with other software.
- Deactivate Plugins: Temporarily deactivate all plugins. If the issue is resolved, reactivate them one by one to identify the culprit.
- Switch Themes: Briefly switch to a default theme like Twenty Twenty-Two. If the columns work there, the issue is specific to Twenty Twenty-One's styles.
2. Inspect and Add Custom CSS
If the conflict check doesn't resolve the issue, the solution often lies in adding specific CSS. Use your browser's inspector tool to identify the problematic classes on your live site.
For Gallery Columns:
If a gallery set to `columns-4` is not displaying correctly, try adding the following CSS via the Customizer (Appearance > Customize > Additional CSS).
.wp-block-gallery.columns-4 {
grid-template-columns: repeat(4, 1fr) !important;
}
For General Column Layouts:
To prevent columns from stacking on mobile, ensure they have a defined width. You can use this CSS to make columns more resilient.
.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
flex-basis: 100% !important;
}
@media (min-width: 782px) {
.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
flex-basis: 0 !important;
flex-grow: 1 !important;
}
}
3. Check for Known Issues
Some issues may be known and tracked by the WordPress community. For example, excessive white space after embeds (like Spotify) was identified as a Gutenberg core issue, not a theme-specific bug. Searching the Gutenberg GitHub repository can provide status updates and workarounds.
When to Seek Further Help
If the problem persists after these steps, it may be a more complex conflict. The next best step is to seek help from the wider community. When asking for help, be sure to provide:
- A link to the page where the problem appears.
- The exact browser and device you are using.
- A list of active plugins.
- Any custom CSS you have already added.
This information is crucial for others to accurately diagnose and help solve the problem.
Related Support Threads Support
-
Background Image Not Responsivehttps://wordpress.org/support/topic/background-image-not-responsive-2/
-
Gutenberg columns are displayed verticalhttps://wordpress.org/support/topic/gutenberg-columns-are-displayed-vertical/
-
How to make Media & Text block width the same as the rest of the content?https://wordpress.org/support/topic/how-to-make-media-text-block-width-the-same-as-the-rest-of-the-content/
-
Comments Closed on WordPress iOS Apphttps://wordpress.org/support/topic/comments-closed-on-wordpress-ios-app/
-
Extra Gap At Top on Additional Pageshttps://wordpress.org/support/topic/extra-gap-at-top-on-additional-pages/
-
How to Extra Padding & Margin to the Side Bar Widgetshttps://wordpress.org/support/topic/how-to-extra-padding-margin-to-the-side-bar-widgets/
-
How to set full width posts?https://wordpress.org/support/topic/how-to-set-full-width-posts/
-
Paragraph block padding in twenty twenty-one themehttps://wordpress.org/support/topic/paragraph-block-padding-in-twenty-twenty-one-theme/
-
Twenty Twenty-onehttps://wordpress.org/support/topic/twenty-twenty-one/
-
custom fields in twenty twenty onehttps://wordpress.org/support/topic/custom-fields-in-twenty-twenty-one/
-
Question theme twenty twentyonehttps://wordpress.org/support/topic/question-theme-twenty-twentyone/
-
allow comments text on pageshttps://wordpress.org/support/topic/allow-comments-text-on-pages/
-
post listing: medium sized image on lefthttps://wordpress.org/support/topic/post-listing-medium-sized-image-on-left/
-
Add thumbnail to post excerptshttps://wordpress.org/support/topic/add-thumbnail-to-post-excerpts/
-
Equal columns heighthttps://wordpress.org/support/topic/equal-columns-height/
-
Twenty Twenty One: post page excerpt paddinghttps://wordpress.org/support/topic/twenty-twenty-one-post-page-excerpt-padding/
-
Safari paragraph spacehttps://wordpress.org/support/topic/safari-paragraph-space-2/
-
[NSFW] overall site widthhttps://wordpress.org/support/topic/overall-site-width/
-
Column Layout for Homepage – Use Templates?https://wordpress.org/support/topic/column-layout-for-homepage-use-templates/
-
Sidebar in Twenty-twenty one themehttps://wordpress.org/support/topic/sidebar-in-twenty-twenty-one-theme/
-
twenty twenty one columns not showing correcthttps://wordpress.org/support/topic/twenty-twenty-one-columns-not-showing-correct/
-
widget in a column in 2021 theme post page column not showinghttps://wordpress.org/support/topic/widget-in-a-column-in-2021-theme-post-page-column-not-showing/
-
Prevent block editor from adding overlap by default to columnshttps://wordpress.org/support/topic/prevent-from-adding-overlap-by-default-to-columns/
-
Have Text Flow Between Columnshttps://wordpress.org/support/topic/have-text-flow-between-columns/
-
Please help: Center column is narrowhttps://wordpress.org/support/topic/please-help-center-column-is-narrow/
-
Need the code for customization sidebarhttps://wordpress.org/support/topic/need-the-code-for-customization-sidebar/
-
Change thickness of Latest Posts divider?https://wordpress.org/support/topic/change-thickness-of-latest-posts-divider/
-
Twenty TwentyOne + Classic Editorhttps://wordpress.org/support/topic/twenty-twentyone-classic-editor/
-
Distorted post images on post pagehttps://wordpress.org/support/topic/distorted-post-images-on-post-page/
-
Comment Section Imageshttps://wordpress.org/support/topic/comment-section-images/
-
Too much white space after Spotify and SoundCloud embedshttps://wordpress.org/support/topic/too-much-white-space-after-spotify-and-soundcloud-embeds/
-
Bug on gallery columnshttps://wordpress.org/support/topic/bug-on-gallery-columns/