Copied!
It's on your clipboard.
You’ve been offline for 0 second. Please check your Internet connection.

Help Us Improve

Found an issue or have an idea? Let us know.
Select all that apply...
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Auto-Hide Container if Nested Loop Grid is Empty
Preview
Overview

This snippet hides the parent container whenever a nested Elementor Loop Grid has no posts to display. It works by checking for Elementor’s built-in empty state message (.e-loop-nothing-found-message) inside the grid. If that message is present, the entire container is removed from view, keeping your layout clean and free of empty sections. This rule only applies on the live site, not inside the Elementor editor, so you won’t run into issues while editing your layout.

Documentation
Code Setup
Walkthrough

Copy To Elementor
Setup: Add Custom CSS

Add this code inside the Custom CSS field of the parent container in Elementor that holds the loop grid and should be hidden when the nested loop grid is empty. The selector tag ensures the style applies only to that container, without affecting others.

Language
Copy
body:not(.elementor-editor-active) selector:has(.e-loop-nothing-found-message) {
  display: none !important;
}

Language
Copy

Language
Copy

Language
Copy

Language
Copy

Language
Copy
Publish and preview live

Some solutions only work on the live site. Always publish and test after each change, as results may not appear in the editor.

Absolutely Codefree
If you were expecting some fancy snippet, sorry. This one runs just fine on its own.
C’mon, You Got This
Do we really need to spell this one out? It’s as straightforward as it gets.
Resorce Details
Collection
Basics
Category
Category
Loop Grid
Interaction
Builder
Last Updated
September 18, 2025