loop_no_results WordPress Action Hook
The loop_no_results hook is triggered when the WordPress loop fails to find any posts to display. This can happen when a search returns no results, or when there are no posts in the specified category. When this hook is triggered, it can be used to display a custom message or run a custom function.
do_action( 'loop_no_results', WP_Query $query ) #
Fires if no results are found in a post query.
Parameters
Source
Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |