Hi,
I have a website in 2 languages (I am using wpml), English and Arabic. I have a main custom type called Training which is linked to a taxonomy Expertise. I translated all value of the expertise. I created all my Trainings from the Arabic website, then I created a view with search filter in the English website and another search view in the English one. I made Arabic posts visible from both websites using:
function wpml_custom_query( $query ) {
$query->query_vars['suppress_filters'] = true;
}
add_action( 'pre_get_posts', 'wpml_custom_query' );
My objective is to search (from the view) for trainings from the any website based on the expertise. All works fine from the Arabic website. From the English website, if I search by keyword, or any other custom field it works, but not if I search by expertise. Do you have any clue please?
I even tried to give the save value to the slug of each expertise in both languages, but in vain.
Dear Nabils,
Are we talking about a custom codes problem? The custom codes you mentioned above will take effect on all wordpress query, see wordpress document:
https://developer.wordpress.org/reference/hooks/pre_get_posts/
Fires after the query variable object is created, but before the actual query is run.
It will conduct some unexpected result, please try these:
1) Disable the custom codes you mentioned above
2) Deactivate other plugins and switch to wordpress default theme, and test again
Thank you for the suggestion. I ended up changing the taxonomy by a checkboxes field and it works.