Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client needs to create a pop-up window for users to choose a language when accessing the website and wants to use the WPML language selector in a different format than the global setting allows.

Solution:
We explained that there is only one global setting for the custom language switcher. If the client requires different layouts for two custom language switchers, they should use the [wpml_language_switcher] shortcode and customize it accordingly. We provided documentation links to guide them:

We also mentioned that it's not possible to change between 'Dropdown' or 'List' styles with the shortcode as this is a global setting. An alternative is to output the language switcher using PHP code, as described in a forum thread: Two Different Custom Language Switchers.

We noted that achieving the desired result may require code customization, which is beyond our support policy's scope. If the client encounters difficulties, we recommend consulting with experienced WordPress Developers knowledgeable in WPML: WPML Contractors.

Please note that the solution provided might be outdated or not applicable to your case. If so, we encourage you to check the related known issues, verify the version of the permanent fix, and ensure 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.

Tagged: 

This topic contains 1 replies, has 2 voices.

Last updated by Mateus Getulio 1 year, 1 month ago.

Assisted by: Mateus Getulio.

Author Posts
April 23, 2024 at 2:04 pm #15556473

joseS-16

Hello, I have a website that uses WPML and I am using the language dropdown customizer. Use this shortcode [wpml_language_selector_widget] in mobile version. In the desktop version use the menu to show the language dropdown. The problem comes now that I am trying to create a pop-up window for the user to choose the language they want to use when accessing the website because I want to use the WPML language selector with another format but I don't know how to edit it independently. Do you understand what I need?

And this other image is an example of what I need to achieve

April 23, 2024 at 3:19 pm #15557103

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

Thank you for your patience while I sent your case to the ticket forum.

There is only one global setting for the custom language switcher as you pointed out: https://wpml.org/documentation/getting-started-guide/language-setup/custom-language-switcher/

If you need a different layout for two custom language switchers, then you need to use the shortcode wpml_language_switcher and customize it accorginly: https://wpml.org/documentation/support/wpml-coding-api/shortcodes/#wpml_language_switcher

Please also check this documentation:

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/adding-language-switchers-using-php-and-shortcodes/

But please bear in mind that you can not change between the 'Dropdown' or 'List' styles with this shortcode, as this is a global setting.

Alternatively, it is also possible to output the language switcher using some PHP code as described by my colleagues in this thread:

https://wpml.org/forums/topic/can-i-have-two-different-custom-language-switchers/

Please check it if you prefer this method.

On a final note, to achieve what you are expecting, it would be necessary to do some sort of code customization, and the scope of our support to custom code is limited: https://wpml.org/purchase/support-policy/

If the implementation becomes a roadblock, we recommend that you consult our experienced WordPress Developers with WPML knowledge: https://wpml.org/contractors/

Best regards,
Mateus.