[Resolved] language switch in header not displayed as dropdown style
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where the language switcher in the header is not displayed as a dropdown style. Solution: We have determined that the language switcher in question is not managed by WPML but is a built-in feature of the Astra theme. We recommend checking the Astra documentation for using the language switcher: https://wpastra.com/docs/using-language-switcher/.
The customization options available for the Astra language switcher include layout (horizontal or vertical), showing country flags, full names, translated names, and language codes. Unfortunately, there does not seem to be an option for a dropdown menu within Astra's settings.
If the dropdown style is essential, we suggest creating a custom language switcher. You can follow these articles for guidance:
Please note that support for custom code, including custom language switchers, is beyond the scope of our support forum. If you need help with custom code, you may need to maintain it yourself or consider hiring assistance from the list of WPML Contractors: https://wpml.org/contractors/.
If this solution is not relevant to your case, because it's outdated or not applicable, 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 you still need assistance, please open a new support ticket: WPML 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.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello,
Based on the 2nd screenshot, given this is available in the customizer, I suspect that the theme might be interfering or overriding with the dropdown available in the widget. You can see that the default one in the menu is working as expected. This might come down to a scenario where you'd have to check with the theme's author for support.
However, in order for me to be sure and check for a potential fix, I would like to request temporary access (wp-admin and FTP). 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.
Our Debugging Procedures
I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link
Please, let me know if you need any additional details. Have a nice day.
Languages: English (English )Portuguese (Brazil) (Português )
Timezone: America/Sao_Paulo (GMT-03:00)
Hello there,
I checked it and that language switcher is not managed by WPML, it is a built-in feature by Astra, please check this for further reference: hidden link
It does look like the only customization options are:
• Layout: You can either display all languages in a horizontal or vertical manner. Horizontal layout mostly applies well to the header while the vertical layout is often better suited for the footer.
• Show Country Flag: This will display flags for countries associated with the chosen language. It helps users to quickly spot the preferred language they are looking for.
• Show Name: This will display the full name for the language.
• Show Translated Name: This will display the translated names for all languages when a specific language is selected. For example – you added 4 languages, let us say English, French, German, and Hindi. When you select the German language, all languages will show their translated names in German.
• Show Language Code: This will display the language code for each language. For example – English (en), French (fr), German (de), and Hindi (hi).
I checked it but I wasn't able to find an option for dropdown menu, you might want to check directly with the Astra support if this feature is available for their custom language switcher.
Alternatively, you might want to consider creating your own custom language switcher by following these articles:
Please have in mind that giving support to custom code even custom language switchers, is out of the scope of this forum. The hints I shared could point you in the right direction, but we can't create, debug or modify custom code for you and it's your responsibility to maintain it.
If implementation becomes a roadblock, you might want to explore the list of WPML Contractors for assistance: https://wpml.org/contractors/