Skip Navigation

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

Problem:
The client wants to place the English language switcher below the search option in the 3rd column of the header on every page of their Divi-themed website.

Solution:
We recommend adding the language switcher to a specific location by using a shortcode. Here are the steps to follow:
1. Enable a custom language switcher and customize it according to your needs.
2. Place the shortcode

[wpml_language_selector_widget]

in your Divi module.
For detailed instructions, please refer to our documentation: Adding language switchers using PHP and shortcodes.

If this solution doesn't look relevant to your issue, please open a new support ticket in our 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.

This topic contains 5 replies, has 2 voices.

Last updated by Nicolas V. 1 year, 4 months ago.

Assisted by: Nicolas V..

Author Posts
December 29, 2023 at 11:33 am #15136580

rinusv

Tell us what you are trying to do?
I want to place the English language indication below the search option, in the 3rd column.
This is the header that appears on every page. Is there a simple code for this?
Site made up in Divi

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
modernglas.nl

plaats engels.png
December 29, 2023 at 4:09 pm #15137135

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Welcome to the WPML support forum.
If you want to add the language switcher in a specific location, you can achieve that by using a shortcode and place it in a Divi module.

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

In short:
- Enable a custom language switcher and customize it as you want
- Place the shortcode [wpml_language_selector_widget] in your divi module

January 2, 2024 at 11:26 am #15142995

rinusv

Good day,
I placed the '<?php do_action('icl_navigation_menu'); ?>' version in the heading on the homepage as intended.
No result. Apparently I am doing something wrong.
Can you please give me the correct code? And do I have to place this on every page or will this then continue in every header?

January 2, 2024 at 12:55 pm #15143446

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello and happy new year!

That PHP code must be used in the PHP templates of your current theme. If you want to place it inside a Divi template you should use the shortcode version as instructed in my previous answer: [wpml_language_selector_widget]

If you still have issues placing that shortcode, please let me know and I'll activate a private field where you will be able to share admin credentials for me. (Don't share them here on the public forum).

January 3, 2024 at 11:45 am #15146253

rinusv

I'm sorry, but I can't figure it out!
Is it possible to do this with css too?
I understand, after some searching that it can only be done in php.
But with the expectation of eventually going to DIVI 5 anyway, I don't feel like doing a php modification.
I'm not that technical, sorry.

January 3, 2024 at 2:44 pm #15147386

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hi,

Sorry if I was unclear, but you only need to use one or the other. You can simply use the shortcode in a divi module (no need for the PHP code in that case).

I made a quick video, I hope it will be helpful: hidden link