This thread is resolved. Here is a description of the problem and solution.
Problem:
I translate the page and save the translation, but when I go to a page for that language i.e. http://example.com/en/about-us/ the content of the header is still the default.
Solution:
First of all, please go to WPML → Settings → Custom XML Configuration tab and add this XML config to it:
Here, edit the Permalink and change fmt-header to fmt-header-es (just simply add -es at the end, so the permalink in each language can be different).
The last step is to go to WPML → String Translation and search for the header template permalink. In the test website is fmt-header. As the translation, just simply add the permalink that you just set, fmt-header-es.
This time, when checking a page in the secondary language, the translated header will be used: https://website.com/es/
I Cannot translate content of the header in my theme, I am using the Indutri theme which comes with a header and footer builder, I need to be able to change the HTML block on the menu to have a different button but none of the changes I make are working.
I translate the page and save the translation, but when I go to a page for that language i.e. hidden link the content of the header is still the default.
I have the site setup with English Australia as default, and English US is secondary.
I have also checked this translation in the strings section and the translation is there.
This site is not currently live so you cannot view because of IP restriction.
I may have found a work around using a custom WPML string shortcode, but if theres anything I'm missing to make the menu switch properly please let me know.
I am not familiar with the Industri theme and with the header builder, so it's hard to say why is this not working well. Also, the Industri theme is not a part of the WPML compatible themes list (https://wpml.org/theme) so there might be some compatibility issues here and there, like the header builder used by the theme.
I can have a look at it (if you could give me access to the dashboard area) but I can't guarantee that I'll be able to make it work with WPML. However, if you found a workaround for this one, it's better to keep using it this way.
Last but not least, if you do need to be able to translate the header elements, you can try t reach out to the theme authors and ask them to check the builder and make it work with WPML. If they need any help with this, they can always apply for the Go Global program (https://wpml.org/documentation/support/go-global-program/) where our compatibility team is waiting to work together with any author and make sure that WPML is working flawlessly with their theme or plugin.
Unfortunately I can't give you access to the site because its behind IP restrictions, what I can do if it would be of any help is send you a copy of the theme files if this is something you are able to test?
If not, I might contact the theme developer and let them know, and just use the custom WPML string shortcode for the moment.
Also with the custom string shortcode, is there any option to say "If translation available, otherwise fallback to default language"?
I've had a chat with our developers and this is not something we are comfortable doing for a minor issue, the solution with the shortcode is working well.
I would be happy to send you the theme files if you would like to take a look but otherwise I might stick with the workaround at this stage.
I'm sorry but even if I would have a look at the theme files, I won't be able to find out what's going on.
The last thing that I can do is to create a clean website: hidden link
You can quickly configure WPML, install the theme, create the same header, and translate it. This way I'll be able to have a look at it and see if I can find any other way to make the HTML block on the translation work.
Thank you for taking care of configuring the website so I can check the issue. I could see that the theme that you're using is saving the header option by using the header post slug (which is not a very practical way of saving the option).
First of all, please go to WPML → Settings → Custom XML Configuration tab and add this XML config to it:
Once you did this, please edit the header template - in the sandbox, is this one: hidden link
Now, use the top admin language switcher and select Spanish: hidden link
Here, edit the Permalink and change fmt-header to fmt-header-es (just simply add -es at the end, so the permalink in each language can be different).
The last step is to go to WPML → String Translation and search for the header template permalink. In the sandbox is fmt-header. As the translation, just simply add the permalink that you just set, fmt-header-es.
This time, when checking a page in the secondary language, the translated header will be used: hidden link
Please give this a try on your website and tell me how it goes.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.