Blank search returns all results
I would like a blank search to return no results
Hi,
Thank you for waiting.
To make sure that the search results are only shown when some text has been entered into the text search field, you can use the "wpv-search-term" shortcode ( ref: https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-search-term ), in a conditional output ( ref: https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/ ).
For example, the structure of your view's content inside the "wpv-items-found" tags in "Loop Editor" section will look like this, with these conditional blocks:
[wpv-items-found]
[wpv-conditional if="( '[wpv-search-term param='wpv_post_search']' ne '' )"]
<!-- wpv-loop-start -->
.....
<!-- wpv-loop-end -->
[/wpv-conditional]
[wpv-conditional if="( '[wpv-search-term param='wpv_post_search']' eq '' )"]
Please enter some text in the search field to view the results!
[/wpv-conditional]
[/wpv-items-found]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thanks Waqar, my issue is resolved now. Thank you!