Problem:
Setting empty search result by the default page when view load
Solution:
you can use view's filter hook wpv_filter_query in order to display no results by defult.
Please try to add following code to your current theme's functions.php file.
add_filter( 'wpv_filter_query', 'show_empty_results_default_func', 10,2 ); function show_empty_results_default_func( $query_args, $setting ) { if($setting['view_id'] == 9999){ if( !isset($_GET['wpv_view_count'])){ $query_args['post__in'] = array(0); } } return $query_args; }
Where:
- Replace 9999 with your original view ID
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 3 months ago.
Assisted by: Minesh.