This thread is resolved. Here is a description of the problem and solution.
Problem:
The floating language switcher was not appearing on the client's site even after translations were approved.
Solution:
We added the following steps to resolve the issue:
1. Inserted this code into the
functions.php
file of the active theme:
add_action('wp_footer', 'wpml_floating_lang_switcher');<br /><br />function wpml_floating_lang_switcher() {<br /> echo '<div class="wpml-floating-language-switcher">';<br /> do_action('wpml_add_language_selector');<br /> echo '</div>'; <br />}
2. Added CSS to style the language switcher in Appearance >> Customize >> Additional CSS:
.wpml-floating-language-switcher .wpml-ls-statics-shortcode_actions {<br /> margin-bottom: 0;<br />}<br /><br />.wpml-floating-language-switcher .wpml-ls-statics-shortcode_actions a {<br /> background-color: transparent !important;<br />}<br /><br />.wpml-floating-language-switcher .wpml-ls-legacy-list-horizontal a {<br /> padding: 5px;<br />}<br /><br />.wpml-floating-language-switcher {<br /> position: fixed; <br /> bottom: 70px; <br /> right: 20px; <br /> z-index: 99999; <br /> background: white; <br /> border-radius: 16px; <br /> box-shadow: 0 4px 16px rgba(0,0,0,0.12); <br /> padding: 8px 16px; <br /> z-index: 99999; <br /> -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);<br /> -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);<br /> box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.25);<br />}
3. Configured the language switcher to display only flags via WPML >> Languages > Custom Language Switcher by pressing the Customize button.
For more details on customizing language switchers, visit Custom Language Switcher documentation.
If this solution does not resolve your issue or seems outdated, please check related known issues, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket here.
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 4 replies, has 0 voices.
Last updated by 4 days, 18 hours ago.
Assisted by: Noman.