Query Has Results
Contains the block elements used to render content when query results are found.
★ 0stars
2release downloads
0forks
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/hamworks/query-has-results/releases/download/0.1.3/query-has-results.zipDeclares an update source (https://github.com/hamworks/query-has-results), so updates arrive through the plugin's own updater.
Readme
Query Has Results
A WordPress block that shows content only when query results exist.
Description
Query Has Results is a WordPress block plugin that allows you to wrap content that should only be displayed when a query returns results. This is particularly useful when working with Query Loop blocks to create conditional layouts.
Features
- Simple wrapper block that shows/hides content based on query results
- Works with WordPress Query Loop blocks
- Supports both global queries and custom queries
- Zero configuration required
Installation
- Upload the plugin files to the
/wp-content/plugins/query-has-resultsdirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress
- Use the Query Has Results block in the block editor
Usage
- Add a Query Loop block to your page/post
- Inside the Query Loop, add a Query Has Results block
- Place any content you want to show only when results exist inside the Query Has Results block
- Content will automatically show/hide based on whether the query returns results
Read the full README on GitHub →