Modifying the text displayed when there are no entries

GravityView Defaults

By default, GravityView shows two values, depending on the situation.

If the View is displaying a search result, the default text is:

This search returned no results.

Otherwise, if no search has been performed, the default text is:

No entries match your request.

Change the text

To modify this, GravityView provides the gravityview/template/text/no_entries filter.

The gravityview/template/text/no_entries filter

Modify the text displayed when there are no entries.

Has two arguments:

  • string $output - The existing "No Entries" text
  • boolean $is_search - Is the current page a search result, or just a multiple entries screen?
  • \GV\Template_Context $context - Information about the current View being rendered

To modify the text, add this sample code (also available here)

Targetting a specific View ID

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.