The Query No Results block displays content when a Query Loop block finds no posts matching the query criteria. This provides a better user experience than showing an empty space.
Adding a Query No Results Block
- Add aย Query Loop blockย first
- Inside the Query Loop block, click theย “+”ย button
- Search forย “Query No Results”ย or find it in theย “Theme”ย category
- Click to insert the block
Note: This block only works within Query Loop blocks and only displays when no posts match the query.
Adding Content
Add any blocks inside the Query No Results block to create your “no results” message:
- Paragraph: Add explanatory text
- Heading: Add a heading like “No Posts Found”
- Button: Add a call-to-action button
- Other Blocks: Add any other blocks for your message
Example Content
A typical “no results” message might include:
- Heading: “No Posts Found” or “Nothing to Display”
- Paragraph: Explanation or alternative content
- Button: Link to browse all posts or other content
Styling Options
Style the Query No Results block like any other block:
- Colors: Text color, background color
- Typography: Font size, font family, font weight, etc.
- Spacing: Padding
- Borders: Border radius, border color, etc.
Best Practices
- Helpful Message: Provide a clear, helpful message
- Alternative Content: Offer alternative content or links
- Professional Appearance: Style the message to match your email design
- Test Scenarios: Test with queries that return no results
Troubleshooting
Block Not Displaying
- The block only shows when no posts match the query
- Verify your query actually returns no results
- Check that the block is inside a Query Loop block
Always Showing
- Check your query settings – they may be too restrictive
- Verify posts exist that match your query criteria
- Review query filters and parameters
Additional resources
Use the links below for more information and guidance on adding blocks. Keep in mind that these articles are general information related to the WordPress Editor and building with blocks. Email Customizer does not utilize all blocks or functionality due to the limited capabilities of emails.
WordPress Editor