Plugin Support
Alex
(@alexcozmoslabs)
Hi,
Could you please give us more details? Feel free to include screenshots or a direct link to browse your website.
Thread Starter
Mandy
(@mafalda1426)
Yes, please see here: https://birdux.studio/ (correct html lang=de) https://birdux.studio/en/ (should be lang=en, but shows lang=de).
Language is currently disabled for external users, so the language switcher is not visible. But it did not work either when the language was enabled.
The website is created with Divi, and the header is created using the Divi Theme builder. But in the header.php it contains correct code:
<html <?php language_attributes(); ?>>
Thanks for your help!
-
This reply was modified 9 months, 3 weeks ago by
Mandy.
Plugin Support
Alex
(@alexcozmoslabs)
Hi,
Thanks for getting in touch and for providing the details.
We had a look at your setup, and based on what you described, the issue seems related to how the Divi Theme Builder handles the header. Even though your header.php includes the correct <?php language_attributes(); ?> function, Divi’s Theme Builder may override parts of the output and cause the <html lang> attribute to remain static across all languages.
TranslatePress relies on the standard WordPress structure to correctly output the lang attribute per language. If the theme or a builder bypasses the core header rendering, the dynamic language attribute might not update properly.
To resolve this, we recommend the following:
- Ensure that the
wp_head() function is present and not removed or altered in any custom headers or templates.
- Temporarily disable the Divi Theme Builder header and check if the
<html lang> attribute changes correctly when switching languages. This can help confirm that the issue is with how Divi overrides the default header.
- If confirmed, consider using the default header or reaching out to Elegant Themes support to ask how to maintain compatibility with dynamic language attributes in custom headers.
Best Regards,
-
This reply was modified 9 months, 3 weeks ago by
Alex.