[Resolved] language on mobile is not showing correct
This thread is resolved. Here is a description of the problem and solution.
Problem: You are trying to adjust the language display on your website for mobile devices and want to change how the language options appear, specifically not in a dropdown menu. Solution: Take kindly note, that this is custom work and our supporters are not obligated to provide solutions in such cases. We have set the menu language switcher to not display as a dropdown on mobile devices by using CSS media queries. 1. We added the following CSS:
You can save this CSS at WPML > Languages > Language Switcher Options > Additional CSS. 2. To display a custom language switcher instead, you can integrate it via PHP or Shortcode. Enable and customize it at WPML > Languages > Custom Language Switcher. For guidance, refer to the following documentation:
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If needed, do not hesitate to 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.
Background of the issue:
I am trying to adjust the language display on my website hidden link. I want to change how the language options appear on mobile devices.
Symptoms:
The language on mobile is not showing correctly, and I don't want it to be in a dropdown menu.
I would like to guide you on this matter, but if you do not have any developer experience you usually might need to consider reaching out to a contractor.
It looks like you have enabled the menu language switcher as dropdown.
This means, on most themes, this menu language switcher will appear inside the hamburger menu on mobile and it will use the same layout.
You can use a CSS media query and set display to none for this element on mobile screens.
This will hide the menu item holding the language switcher on screens with a width of 480px or less.
You can save this CSS at WPML > Languages > Language Switcher Options > Additional CSS.
Now, you can create a Custom Language Switcher and use another specific media query remove this one on desktop screens.
Custom Language Switchers can be integrated by PHP or by Shortcode. You will find an option to enable and customize the Custom Language Switcher at WPML > Languages > Custom Language Switcher.
If you need further assistance with this implementation I can make and exception and assist you, but please take note that our supporters ar enot obligated to get pro-active on custom code requests.
I truly appreciate that you're making an exception to assist me with this, as I don't have much knowledge in coding. I understand this is an exception. Thank you so much for your understanding! How can I send u login details to WordPress?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Hi,
I would like to request temporary access (wp-admin and FTP) to the site to investigate the issue further.
The required fields are below the comment section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.
IMPORTANT
Please be sure to back up the site and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and site login details will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields.
The private reply form looks like this: hidden link
The next time you reply, click on "I still need assistance".
Video: hidden link
Please note that we are obliged to request this information individually on each ticket. We are not allowed to access any credentials that were not specifically submitted on this ticket in the private response form.
Further, I have installed the WP Code Plugin and created the following hook to display the WPML Custom Language Switcher in Divi's Top Header.
function custom_content_before_menu() {
echo '<div class="wpml-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>';
}
add_action('et_header_top', 'custom_content_before_menu');