Tell us what you are trying to do?
I'm trying to use toolset documentation to hide search results on my site until the first search. Using the link below, I'm adding the conditional block exactly as listed, using the advanced editor to add the following:
( ( '[wpv-search-term param='wpv_view_count']' ne '' ) )
"Then dragging the view loop into it. All it does is change the formatting. It does not hide the results. I've attached images of the tool before the conditional block is added and after.
Hello. Thank you for contacting the Toolset support.
You must be adding the conditional to different place.
Can you please share problem URL and admin access details and let me review whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I'm not comfortable yet giving anyone admin credentials. Is there a way to provide me a test site to setup my forms in so that you can help me? I went ahead and completed the process again. See the attached images for the conditional block placement and for the conditions, per the tutorial above. Problem link is in the first post.
I can also upload the page code if that helps in the interim. Please let me know. Thank you.
Ok, I tried the custom code and added my view ID of 300. I'm getting an error:
"Snippet "hide-results-before-search" has been updated.
There was error when trying to re-run the snippet:Unexpected output of the code snippet: add_filter('wpv_filter_query', 'func_hide_search_result_until_search_perform', 99, 3); function func_hide_search_result_until_search_perform( $query_args, $view_settings, $view_id ) { if($view_id == 300 ){ if( !isset($_GET['wpv_view_count'])) { $query_args['post__in'] = array(0); } } return $query_args; }"
Can you please edit your code snippet and put the following lines before you add your code snippet:
<?php
/**
* New custom code snippet (replace this with snippet description).
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
// Put the code of your snippet below this comment.
Just put above lines of code to your code snippet and then you should add the filter hook code I shared and save your code snippet.
Hello. I edited my code to add the above lines and it removed the error. However, it did not hide the results yet. Here's a screenshot of the code, as well as some other custom code I have to filter duplicates in case it's causing issues with the your code.
Can you please share problem URL where you added your view as well as admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.