[Resolved] Templates not applied to translated languages
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing two issues: 1) The language switcher is not functioning and does not offer any languages to switch to. 2) Translations are done, but the wrong template is assigned to the translated pages, and attempts to change the template revert back to the default one.
Solution: We suspect that the client might be encountering a known issue related to templates not being applied to translated pages. We recommend: 1) Checking the problem against the known issue described here: https://wpml.org/errata/template-is-not-applied-to-translated-page/ 2) Ensuring to back up the database before making any changes.
Please note that the solution provided might be outdated or not applicable to your case.
With this specific case, we suggested using SQL queries to overcome the issue for the client.
If the issue persists, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If none of these steps resolve the issue, please do not hesitate to open a new support ticket with us.
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.
Tell us what you are trying to do?
I've created a site in English. I installed WPML and translated it all in 6 languages, automatically. It costed me 83k credits.
1) the language switch at the top isn't functioning. It offers no language to switch to.
2) the translations are all done when you guess the URLs, but the wrong template is assigned. If I change to another template, it'll revert back to the vanilla one.
Is there any documentation that you are following?
WPML plugin UI and site Documentation
Is there a similar example that we can see? hidden link hidden link hidden link
The description sounds familiar indeed. I tried to follow the steps described and was not able to fix my issue:
- The language switch doesn't pull up the other languages available.
- Navigating to the translated URLs shows the with the proper content but without the proper template applied.
For a moment I was able to see the FR homepage with the right template and now it's gone.
Would you please mind having a quick look to confirm the steps described solve my problem? Maybe I missed something on restranslating the templates in the end?
Thank you for your feedback. I 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. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
I'm still tweaking the site's header, but I can log out entirely if you need full control with no one messing around. I'm stuck without your help. Any time will work with me!
Thank you for your feedback, Stephane. To ensure I do not break your current site, can I make a copy of your website for local tests?
For this, I'll need to temporarily install a "Duplicator" plugin on your site. This will allow me to create a copy of your site and your content. If you prefer to do it independently, you can provide me with the snapshot and send me the installer file and the zipped package you downloaded.
I played around and was able to get the language switch to work again. I can change languages now.
However, (1) templates still aren't sticking to their localized pages and (2) "WP menu sync" is still empty.
Thank you for the update. You can keep working on your website. I will make a copy to test the issue in a local environment and will keep you posted. Have a lovely weekend!
I appreciate your patience. The issue has been reported to our development team. In the meantime, I am sharing the steps to fix the problem manually in the following private reply.
Thanks for your feedback and congrats on identifying the root cause. I'd NEVER have thought of that. I still have 2 issues:
1) The front page template is addressed in all languages. That's good. However, all the other pages use a template called "Templates des pages 2024". Similar to how it's been for the front page, the template won't stick with the localized versions.
>> Could you share the SQL query I should run to fix this ?
2) the "WP Menu Sync" module seems to be dysfunctional. It says there is nothing to sync. As a result, the header IS translated but not the site links. I did press the "Translate Link Targets" on the Settings page to force the syncing but in vain.
>> How can I get the correct URLs to show up on the localized headers?
Thank you for being so supportive.
Stephane
New threads created by Andrey and linked to this one are listed below: