Problem:
In this ticket the user wanted to start out with a blank results page when no search has yet been performed.
Solution:
This can be achieved by using the hook below. Add the following to your toolset custom functions in Toolset -> Settings -> Custom Code.
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; }
Change the '9999' to the ID of your view and this should cause your view to start with an empty search page.
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 |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 16 replies, has 2 voices.
Last updated by 5 years, 5 months ago.
Assisted by: Shane.