Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.
You will need to create a custom language switcher and set the first menu href to "#" or remove it.
Upon searching the forum, I found a solution shared by a client so I am sharing it with you, remember this is not tested by us and no further support on this code will be provided as it's a custom code solution.
Add this code to your theme functions.php file, this will remove the href for the first item of the dropdown menu
function custom_inline_scripts() {
if (is_admin()) return; // Don't add scripts in the admin area
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.wpml-ls-item.has-sub.wpml-ls-current-language').find('a:first').removeAttr('href');
});
</script>
<?php
}
add_action('wp_footer', 'custom_inline_scripts');
The custom solution shared by my colleague requires you to add this language switcher code in your theme's functions.php file and then enable the custom switcher option shown in your screenshot.
However, before going the custom solution route, have you tried changing the type of dropdown to a dropdown click one?
To do this go to WPML->Languages->Widget language switcher -> add a new and select dropdown click.
Also, edit the widget switcher in the backend and remove the language from showing twice. Deutsch (German) uncheck "Language Name in Current Language""
Let me know your results, please.
The topic ‘[Closed] Language Switcher Link’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.