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.

This topic contains 1 reply, has 2 voices.

Last updated by Dražen 1 year, 10 months ago.

Author Posts
June 8, 2023 at 10:47 pm #13796225

ufukS-4

Hello, I had the same issue before. After the update I am still facing the same problem.
There was no problem before but after tema updating the codes are not working. I tried them both in appearence>additional css and wpml>languages but the result is same. I don't see the floating switcher on my site. I get an error when I add the following code to the functions.php file. If you tell me how you solved the problem or what the error is, I will not open a ticket again and bother you. Thank you.

//WPML - Add a floating language switcher to the footer
 add_action('wp_footer', 'wpml_floating_language_switcher');
  
 function wpml_floating_language_switcher() {
    echo '<div class="wpml-floating-language-switcher">';
        //PHP action to display the language switcher (see https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#using-php-actions)
        do_action('wpml_add_language_selector');
    echo '</div>';
}

June 9, 2023 at 8:36 am #13797801

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I have used admin access from another ticket you have and checked your website.

Seems all is working well, maybe you have pasted wrong code.

I have added the next code to your functions.php:

//WPML - Add a floating language switcher to the footer
 add_action('wp_footer', 'wpml_floating_language_switcher'); 
  
 function wpml_floating_language_switcher() { 
    echo '<div class="wpml-floating-language-switcher">';
        //PHP action to display the language switcher (see https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#using-php-actions)
        do_action('wpml_add_language_selector');
    echo '</div>'; 
}

Then added CSS to custome CSS:

/*Customize this if you want*/
.wpml-floating-language-switcher {
  position: fixed;
bottom: 10px;
  right: 10px;
  background: #f8f8f8; /*background color*/
  border: 1px solid; /*border settings*/
  border-color: #eee; /*color of the border*/
  padding: 0px; /*padding of container*/
  border-radius: 6px; /*rounded border*/
  /*Box Shadow*/
  -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);
}

Regards,
Drazen

Screenshot_3.jpg

The topic ‘[Closed] Floating Language Switcher's css codes are not working.’ is closed to new replies.