[Resolved] Language Switcher Not Showing with English on Author Page
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where the language switcher on the author page only displays the primary language (Dutch) and does not show the option to switch to English, despite the English version of the author page being accessible directly via its URL. Solution: We recommend checking if the author of the posts on the author page has their posts translated into the secondary language (English). The language switcher will only appear if the author has blog posts and they are translated. If the posts are translated and the issue persists, you may need to implement custom coding to ensure the language switcher always appears. An example of how to handle this with custom code can be found in our support forum: https://wpml.org/de/forums/topic/empty-author-archive-langauge-switch/#post-14442559.
This solution might be outdated or not applicable to your specific 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 the issue persists, please open a new support ticket at our 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.
Background of the issue:
I am trying to display a language switcher on the author page of my website, which is set to Dutch as the primary language and English as the secondary language.
The primary language author page URL is hidden link and the English language author page URL is hidden link.
I have verified that both language versions of the author page exist and have translated all strings in both languages. I also created custom fields using Advanced Custom Fields (ACF) for the user and configured the ACF Field Group with the appropriate WPML settings.
I have created author page with Elementor template. which called globally for all authors profile page.
Symptoms:
Language switcher only displays the primary language (Dutch) on the author page, and the option to switch to English is missing.
English version of the author page is accessible directly via its URL, but it is not appearing as a selectable option in the language switcher.
Questions:
Why is the language switcher not showing the option to switch to English on the author page?
How can I make the English language option appear in the language switcher on the author page?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+02:00)
Hi,
This behavior is expected since the author archive functions as an archive rather than a regular page. As a result, custom post types (CPTs) are not included by default in the query where the language switcher is typically displayed.
In the solution provided in the thread, the issue was related to the Custom Post Type (CPT). However, we are not experiencing the issue on the CPT archive page.
Our issue is different: the language switcher is not showing the English language option on the author page.
Here is the author page link for reference: hidden link
In our site all other pages (like archive and single) are displaying the language switcher correctly with both language options, but the author page is only showing the primary language.
See the screenshot here for clarification: hidden link
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+02:00)
Hi,
I believe there was a misunderstanding in my previous response.
This is expected. The lang switcher on the author archive page will only appear if the author has blog posts + they are translated. In the profile you shared, the posts are written from another user hidden link.
1) So you can either re-assign the author of the blogs and ensure they are translated
2) Use custom coding to always show the lang switcher. There are several ways to handle this. You can see an example here:
The author informations are tranlateted by string translation. This works well, if the author have posts. But if the author has no direct posts, no language switcher is shown.
In this case, the client implemented a custom function that modifies WPML’s language switcher on author archive pages, ensuring it only displays languages with a translated author description. The function retrieves active languages, checks for a translation, updates the author archive URL, and removes untranslated languages from the switcher. While this requires custom development, this example provides a useful reference to understand the approach.