 hasanH-6
|
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.
Questions:
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
Hello,
Take kindly note that the behavior on your site is expected and any further customziations are custom work that is not covered by our support policy.
https://wpml.org/purchase/support-policy/
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.
@media screen and (max-width: 480px) {
#menu-item-wpml-ls-4-sv {
display: none;
}
}
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.
PHP Guide:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/
Shortcode:
https://wpml.org/documentation/support/wpml-coding-api/shortcodes/#wpml_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.
Best regards
Andreas
|
 hasanH-6
|
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?
|
 Andreas W.
WPML Supporter since 12/2018
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.
Best regards
Andreas
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
Spanish (Español )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
Please revise your site now.
I have added the following CSS at WPML > Languages > Language Switcher Options > Additional CSS:
@media screen and (max-width: 980px) {
#menu-item-wpml-ls-4-sv {
display: none;
}
.wpml-language-switcher {
display: inline-block;
position: relative;
bottom: 6px;
right: 6px;
}
}
@media (min-width: 981px) {
.wpml-language-switcher {
display: none;
}
}
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');
|