[Resolved] I can't display the language switcher on both languages.
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to display the language switcher on both languages on their website using WPML. Solution: We resolved the issue by editing the Elementor's English header template. Initially, the incorrect menu was selected. We changed it to the correct menu: 'MainMenu - Czech', updated the template, and confirmed that the language switcher now displays correctly on the English version of the site.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
To further troubleshoot the Language Switcher in the menu problem, please try the troubleshooting section.
1. Take a backup of the DB of your site.
2. Go to WPML -> Support -> Troubleshooting (link)
3. Once on the troubleshooting screen, press the following buttons and check if it helps. Press each button in turn and wait for the process to complete.
- 'Disable cache for language switcher templates'
- 'Clear language information and repopulate languages' button (if it is showing)
- 'Synchronize posts taxonomies' for 'all post types'
- 'Clear the cache in WPML'
- 'Remove ghost entries from the translation tables'
- 'Fix element_type collation'
- 'Fix WPML tables collation'
- 'Synchronize local job ids with ATE jobs'
- 'Synchronize translators and translation managers with ATE'
- 'Assign translation status to duplicated content'
- 'Set language information'
- 'Reset languages' Press this button only if you didn't add a custom language!
- 'Fix terms count'
- 'Fix post type assignment for translations'
- 'Cleanup and optimize string tables'
- 'Clear invalid strings'
*** Please make a backup of your database before using this.***
We suspect a collision with the custom child theme or with another plugin might be causing this problem. If possible, get your site down to a minimum environment, switching to the Hello Elementor parent theme and activating only WPML and Strings Translation.
1. Update the parent Hello Elementor theme to its latest version.
1. Switched to Hello Elementor parent theme.
2. Go to WPML -> Languages -> Footer language switcher and enable the 'Show language switcher in footer' option and click the Save button.
3. Check if the problem persists.
If it persists, the problem is likely in custom code in your child theme.
4. If it persists, deactivate all plugins except WPML and Strings Translation. Then, please check if the problem persists.
5. If it does not continue, start by activating the plugins individually and checking when the issue comes back, then report to me which plugin was the culprit.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****
*** If your site is live, you might want to try those procedures in a staging environment or a snapshot of your site on your local server or another server. ***
I fixed the problem on your site. The Language Switcher now displays on the English version of your site. Please see the attached screenshot en-menu-ok.jpg.
I edited Elementor's English header template and noticed that the selected menu is incorrect. So I switched it to the correct menu: MainMenu - Czech. Please see the attached screenshot switch-menu.jpg. I updated the template, and now it works.
Can you please confirm that this problem is fixed now?