Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 -
- - - - - - -

Supporter timezone: Pacific/Easter (GMT-06:00)

This topic contains 1 reply, has 0 voices.

Last updated by Ilyes 7 months ago.

Assisted by: Ilyes.

Author Posts
November 19, 2024 at 10:00 am #16418588

magnusJ-3

Background of the issue:
I am trying to place the language switcher in a specific position within the WordPress menu using WPML. I want it to be at position 4 out of 5 in the menu.

Symptoms:
I am unable to position the language switcher at a specific place in the WordPress menu.

Questions:
How can I place the language switcher at a specific position in the WordPress menu using WPML?

November 19, 2024 at 4:41 pm #16420862

Ilyes
Supporter

Languages: English (English ) French (Français ) Arabic (العربية )

Timezone: Pacific/Easter (GMT-06:00)

Hello,

Thank you for contacting WPML support team,

Unfortunately, the two position offered by WPML are either before the menu (first item) or after the menu (last item). We don't have an option to insert it in the middle of your menu.

But in case you want to use a customized code, we have a shortcode for it, to offer you more flexibility.
You will need to use language shortcode and add it to the part where you wish, as a menu item or via PHP code.

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

Look at how to add a shortcode inside a menu. A quick search on google brings this link: hidden link

Alternatively if you're comfortable with code, you could look at the wp_nav_menu_items hook to insert your last link after the switcher.
Ref: https://developer.wordpress.org/reference/hooks/wp_nav_menu_items/

Here is one similar ticket: https://wpml.org/forums/topic/change-menu-language-switcher-position-to-second-last/

Note: Custom codes are not part of our support service

Best,

The topic ‘[Closed] Put the language switcher in a specific place in the wordpress menu?’ is closed to new replies.