Hello. Thank you for contacting the Toolset support.
As I understand, for the filter "Bezetting", for instance if user select the checkboxes option "Allround dj" and "Zanger" you want to only display the results where both "Allround dj" and "Zanger" are checked - correct? if yes:
- You will require to use the view's filter wpv_filter_query to adjust the view's query on fly.
If you do not know how to do it, please send me admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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 just noticed that you are using the archive instead of view.
There is no way to change the clause to "And" instead of "Or" for the custom filter when using the archive. I checked both pre_get_posts and posts_where hook but I do not see any easy way to change the query as required.
Now I just need the view to show only results from the current category. I created a template for artist categories in Divi's theme builder with this view, but the view shows all results instead of only the results of the current category. Can you help me with that as well?
And I'm doubting to filter the "muziekgenre" the same way. How can I add that to your code?
Never mind the first question, figured that out already. I was still using the category filter in my user filters, when I removed it there, I could configure the view to only show posts in the current category.
Then only my second question remains: "And I'm doubting to filter the "muziekgenre" the same way. How can I add that to your code?"
Hmm there still seems to be one problem... auto refresh doesn't seem to work correctly on this page: hidden link. I have to manually refresh the page to apply the filters.
That's a copy of the view used on the category pages, which has a different ID. I modified your code to add that ID, but I probably did something wrong. I changed the code to
add_filter( 'wpv_filter_query', 'func_change_filter_clause',10,3 );
function func_change_filter_clause( $query_args ,$view_settings,$view_id) {
if ($view_id == 1228||1331 ) {
I found the problem. I embedded another view in the loop item to show values from a related post type. That caused the filter system not to work correctly. I now removed that embedded view, now it works again. So it had nothing to do with your code indeed 🙂