[Resolved] Jet Smart Filter: URLs are not translated in filtered content.
This thread is resolved. Here is a description of the problem and solution.
Problem: If you're using the JetSearch plugin to filter blog posts and it's working fine for the default language but showing non-translated content for other languages, we have a solution for you. Solution: First, ensure you have a complete backup of your database and website. Then, apply the following workaround:
//WPML workaround for compsupp-6886 - Part I
if ( isset( $_GET[ 'wpml_lang' ] ) ) {
do_action( 'wpml_switch_language', $_GET[ 'wpml_lang' ] ); // switch the content language
}
Using the Jet Smart Filter plugin to filter the blog posts. It's working fine for the default language. But showing non-translated content for all other languages.
Thank you for contacting WPML support, I'd be happy to help you with this issue.
According to the Debug info, I the Posts translation preference is "Translatable - use translation if available or fallback to default language" in WPML > Settings > Post Types Translation.
Please try to:
- Set the preference to "Translatable - only show translated items".
- Or translate the post to second language.
then let me know how it goes.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated. Your next reply is set to private to share the info.
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.
- Posts translation preference is still set to "Translatable - use translation if available or fallback to default language" in WPML > Settings, please check the screenshot hidden link
- The posts are not translated into second languages, please check the screenshot hidden link
Then I set the Posts translation preference to "Translatable - only show translated items" and it fixes the issue. Can you please confirm it works on your site?
As in your screen record (from second 41), you can see the text "Add translation to South Africa". That means the post is not translated into South Africa language. You can also edit the post and check the translation in the Language box, please see this screenshot hidden link
The post "5 Ways to Cut Down Admin Time With Job Management Hacks" is only translated into Canada language and it is available on the Blog page in Canada language. hidden link
Hi Long Nguyen, I think you did not get my point, the issue is that the filtered posts links are not translated.
You are right that the "5 Ways to Cut Down Admin Time With Job Management Hacks" post is only translated in Canadian language. so now to recreate the issue we are facing, please follow the steps below.
1. go to hidden link
2. search for "5 Ways to Cut Down Admin..." in the search box hidden link
3. click on "5 Ways to Cut Down Admin Time With Job Management Hacks" post from the search results.
4. it will take you to the default language hidden link instead of the Canada version.
The filter by categories displays the post in the Canada language correctly, just the results in the search form do not display the post in the Canada language. Please check this screenshot hidden link
The search form is created by the plugin JetSearch, so can you please help me to replicate the issue on a clean installation of WordPress? You can access the WordPress dashboard using the link below: hidden link
Kindly follow the steps below:
- Don’t restore your site there.
- Install the JetSearch plugin.
- Try to replicate the issue.
- Then let me know the steps to replicate it.
I see the issue happens in the preview results box only, if you click on "See all results" and the translation post is displayed correctly there.
I'm asking our 2nd tier support about this issue and update you here when I have something to share. Meanwhile, please try to contact the plugin JetSearch author and ask them about this issue if they are aware of this.
I got a workaround from our 2nd tier support to fix this issue, please check it below:
1. IMPORTANT: Please backup your database and website before proceeding.
2. Edit the file /wp-content/plugins/jet-search/includes/ajax-handlers.php, around line 61, below the code
public function init() {
add this code
//WPML workaround for compsupp-6886 - Part I
if ( isset( $_GET[ 'wpml_lang' ] ) ) {
do_action( 'wpml_switch_language', $_GET[ 'wpml_lang' ] ); // switch the content language
}
3. Edit the file /wp-content/plugins/jet-search/includes/assets.php, around line 165, below the code