Home›Support›English Support›[Resolved] I am working on a site under development and trying to implement the WPML language switcher.
[Resolved] I am working on a site under development and trying to implement the WPML language switcher.
This thread is resolved. Here is a description of the problem and solution.
Problem: The WPML language switcher only appears on the homepage and does not function on other pages, including a Russian page. The client is using a custom theme. Solution: If you're experiencing this issue, we recommend adding a custom language switcher or using a shortcode or hook/filter. Ensure that: 1. The template where the language switcher is added is translated. 2. The pages where the language switcher should appear are translated and published. We suggest checking the following guides for detailed instructions:
If after ensuring all content is translated and published the issue persists, test with a standard theme to check for conflicts in your custom theme's coding.
Please note that the solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.
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.
Background of the issue:
I am working on a site under development and trying to implement the WPML language switcher. The site is hosted at hidden link. I have a page in three languages, including Russian, and I want the language switcher to work across all pages.
Symptoms:
The WPML language switcher appears only on the homepage and does not appear on other pages. On the Russian page hidden link, the language switcher dropdown is not working hidden link.
Questions:
Why does the WPML language switcher only appear on the homepage?
How can I make the WPML language switcher work on all pages, including the Russian page?
Since you're using a custom theme, you may need to add a custom language switcher or add the language switcher using a shortcode or hook/filter. Additionally you may also need to consider the following:
- The template where this is added, must be translated.
- The pages where you expect this to appear, must have been translated and published.
Please note that WPML Language Switcher provides a barebone structure, which means, it should inherit most of the styles and features from the theme or site design. Additionally it shouldn't pose any conflict. However, if the templates, pages and content is translated and published but switcher still doesn't work, try the same approach with a standard theme. So you can determine if there's a conflict in your custom theme coding, causing this behavior.
Adding Language Switchers Using PHP and Shortcodes
How to Add a Language Switcher to Your WordPress Site
Custom Language Switcher
The language switcher works well on posts and the home page, but it is not working on other pages. I checked using Inspect, and it is not retrieving anything—it just shows an empty div hidden link.
Why its happening and i am using shortcode in my theme
Can you clarify about "other pages"? I mean are these custom post type based and translated? As well as have you tried the same approach with a standard theme?
I understand you're using a custom theme but point is to reproduce the issue, by porting those pages and this language switcher functionality to a standard theme and check.
As per my understanding, if this is working with Posts and Home Page, there mush be something conflicting with your custom code. Please note that support for custom coding is out of scope of this forum, however, if you can reproduce the issue with standard theme and WPML only plugins, we'll try our best to check and provide a solution.
You can see the language dropdown menu here: hidden link . However, when I hover over the dropdown, it doesn’t show the other languages. Also in the footer its only show english lang.
If you find any solution for this, please let me know.
Have you reproduced the issue with standard theme and WPML only plugins? Because as I mentioned earlier, if this is working on some pages (i.e. home page, publications and posts) while not on other pages, then problem is somewhere with the custom code being used in your theme or coming from another plugin.
If you can reproduce the issue as requested above, please let me know.