Skip Navigation

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

Problem:
The client wants to format the language switcher in their website header to display languages with a '/' between them, specifically as 'EN/GR'.
Solution:
If you're experiencing this, we recommend you follow these steps:
1. Enable the language switcher.
2. Configure it to show only language codes by following the instructions here: https://wpml.org/forums/topic/use-language-abbreviations-in-menu-language-switcher/
3. Use custom CSS to add '/' between the languages. Here is an example of how you can do it:

.wpml-ls li.wpml-ls-item a:after {
   content: "/";
    margin-left: 13px;
}
.wpml-ls li:last-child.wpml-ls-item a:after {    
content: "";
}

This solution might be irrelevant if it's outdated or not applicable to your 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 this does not resolve your issue, please open a new support ticket at 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 reply, has 0 voices.

Last updated by Shekhar Bhandari 1 week ago.

Assisted by: Shekhar Bhandari.

Author Posts
November 18, 2024 at 9:00 am #16413545

christosK-16

Background of the issue:
In my header, I have added the shortcode for the language switcher. My languages are 2: EN & GR. I want to know if there is any way to add / between the languages. I mean I want the language switcher to have this form: EN/GR.

Symptoms:
I am unsure how to format the language switcher to display languages with a / between them.

Questions:
Is there a way to format the language switcher to display languages as EN/GR?

November 18, 2024 at 11:06 am #16414364

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you on this issue.

By default we don't have an option to show the switcher as you mentioned, but you can use some custom css to achieve it.

The steps will be:
- Enable language switcher
- Show only language codes: https://wpml.org/forums/topic/use-language-abbreviations-in-menu-language-switcher/
- Now using css you can add / to the switcher, an example css will be

.wpml-ls li.wpml-ls-item a:after {
    content: "/";
    margin-left: 13px;
}

.wpml-ls li:last-child.wpml-ls-item a:after {
    content: "";
}

Let me know if this helps.

Thanks