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
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 0 voices.

Last updated by Noman 1 week, 6 days ago.

Assisted by: Noman.

Author Posts
June 11, 2025 at 2:09 pm #17126404

nicolasF-39

Background of the issue:
I am trying to style the switcher with your documentation:"https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/". It just looks weird

Symptoms:
I also tried to add the php to my child theme and it still does not work

Questions:
Why does the language switcher styling guide not work for my site?

June 11, 2025 at 4:19 pm #17127190

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. To display floating language switcher on your site, please make sure to follow the below steps:

1. Add the below code in functions.php file of your active theme:

add_action('wp_footer', 'wpml_floating_language_switcher'); 
  
 function wpml_floating_language_switcher() { 
    echo '<div class="wpml-floating-language-switcher">';
        
        do_action('wpml_add_language_selector');
    echo '</div>'; 
}

2. Add the below CSS in the custom CSS section of the theme:

.wpml-floating-language-switcher .wpml-ls-statics-shortcode_actions {
  margin-bottom: 0;
}
  
.wpml-floating-language-switcher  .wpml-ls-statics-shortcode_actions a {
  background-color: transparent !important;
}
  
.wpml-floating-language-switcher .wpml-ls-legacy-list-horizontal a {
  padding: 5px;
}
  
.wpml-floating-language-switcher {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: #f8f8f8; 
  border: 1px solid; 
  border-color: #eee; 
  padding: 0px; 
  border-radius: 6px; 
  
  -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);
  -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);
  box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);
}

3. Go to WPML >> Languages > Custom Language Switcher section, check the Enable checkbox, press the Customize button, choose the similar options as you can see in the attached screenshot, and press the Save button.

And it should display as you can see in the attached screenshot.

If the issue still persists, please add the debug report in the Debug Information box. I have also enabled debug info box for your next reply: https://wpml.org/faq/provide-debug-information-faster-support/

Kindly let me know the results,
Thank you

custom language switcher.jpg
language switcher styling.jpg
Preview 1.jpg
June 11, 2025 at 4:36 pm #17127292

nicolasF-39

It looks like these now which I do not want at all... It's not floating. It's just at the bottom of the footer. That's why I wanted it to put the shortcode into floating element in elementor...

Bildschirmfoto 2025-06-11 um 18.32.59.png
June 12, 2025 at 10:18 am #17129501

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the update. The switcher added with the code I shared is the same floating one we show in our documentation. You can adjust its position using CSS, for example, try changing bottom: 10px; to something like top: 150px; to better fit your layout as you can see in the attached screenshot. Here you can see a demo link: hidden link

If you have a specific design in mind, feel free to share a screenshot or example link, and I’ll be happy to guide you further.

Thank you for your cooperation

floating switcher.jpg

The topic ‘[Closed] styling Language Switcher’ is closed to new replies.