Repository navigation
Blocks Query No Results
Block name: designsetgo/query-no-results
Added in: 2.1.0
Category: DesignSetGo
Block family: Query (parent) · Query Results · Query Pagination · Query Filter · Query Group Header · No Results
The No Results block renders its content only when the parent Dynamic Query returns zero items. Place it as a sibling of Query Results anywhere inside the Query block's tree — it can appear before or after the results.
The block is a free-form InnerBlocks container: add any blocks inside it — a heading, a paragraph, a link back to the full archive, a Query Filter reset button — to create the empty-state message and any helpful recovery actions.
This block has no configurable attributes beyond standard WordPress block supports (color, typography, spacing).
The block reads the parent query's totalItems from the per-request state registry after the query has run. It renders its authored content when totalItems === 0. It renders nothing (returns empty) when totalItems > 0.
Two scenarios produce totalItems === 0:
- The base query has no matching posts — for example, a query for a custom post type that has no published entries
- Active filters intersect to zero — the user has applied one or more Query Filter selections that together match no posts; because every filter refresh re-runs the query and updates the state registry, the No Results block responds correctly to filter-driven zero states as well as base-query zero states
In the editor, the block always shows its inner content so authors can design the empty state without needing to temporarily remove posts from the database. The conditional render logic runs only on the frontend.
To preview how the block will look when there are no results, save the page and temporarily change the query to target a post type or taxonomy with no published posts.
No block-specific controls. The standard WordPress color, typography, and spacing supports are available in the Styles panel.
A minimal empty-state message:
[No Results block]
[Heading] "No posts found"
[Paragraph] "Try adjusting your filters or search for something else."
[Query Filter — reset kind] "Clear all filters"
A more helpful empty state that links back to the archive:
[No Results block]
[Heading] "Nothing here yet"
[Paragraph] "We couldn't find any results. Try a broader search."
[Buttons block]
[Button] "View all posts" → /blog
When rendered (zero results), the block wraps its authored content in a <div> with class="dsgo-query-no-results" plus any native-supports classes (color, spacing) the author applied:
<div class="dsgo-query-no-results wp-block-designsetgo-query-no-results">
<!-- authored inner blocks -->
</div>When there are results the block outputs nothing — no wrapper element, no hidden markup.
- The block outputs nothing when results exist, so there is no need to hide it with
display:noneoraria-hidden - The authored content renders as normal flow content; use appropriate heading levels and ensure any links or buttons have descriptive labels
- Dynamic Query — the parent container; owns the query that determines totalItems
- Query Results — the sibling that renders when totalItems > 0
- Query Filter — filters can produce zero results; pair with a reset kind to give users a recovery path
- Query Pagination — also hides itself when totalItems is 0 (totalPages < 2)
Auto-generated from
docs/blocks/QUERY-NO-RESULTS.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2