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.