-
AuthorPosts
-
April 21, 2022 at 1:29 pm #1349023
Dear Team,
Recently came across a problem that started after the latest theme update.
Problem: WPML language switcher reloads the page once clicked.
The language switcher consists of a parent menu item (Current language) by clicking on which a dropdown consisting of all languages appears and then the needed language can be chosen.
In my situation the parent menu item on mobile acts like a link to the language it represents, thus resulting in a page refresh.I have contacted WPML but they successfully redirected me to you :( as strangely enough there was no such a problem in the sandbox environment with a fresh theme installation.
– I tried disabling all plugins except WPML – no result,
– removing all custom CSS – no result,
– removing Google trackers – no result.I was wondering whether you could look from your side into the installation, maybe you would be able to see source of error way faster than I.
Looking forward to hear from you soon.
Please take a look at the WPML support thread. It starts as a different issue but on the second page there is more on the menu problem. These two problems may indeed be related.
Also let me know once you are going to look at the website, I will switch the menu back to where the problem is visible, at the moment the parent menu on mobile is switched off.
Looking forward to hear from you soon.
Website: http://www.smileicon.eu WPML thread: https://wpml.org/forums/topic/product-translation-not-found-in-coupon-settings/page/2/#post-11064083
Best,
AlexApril 25, 2022 at 5:13 am #1349337Hey Alex PS,
Thank you for the inquiry.
Problem: WPML language switcher reloads the page once clicked.
That is the default behavior of the language switchers. The switcher just redirects the site to a different page with a different language, so expect the page to refresh once you clicked the switcher. Are you expecting the page to immediately switch to the other language without refreshing?
Could you give us an instruction on how we can reproduce the issue?
Best regards,
IsmaelApril 25, 2022 at 12:36 pm #1349392Hi Ismael,
The switcher once clicked simply refreshes the current language and does not give me enough time to pick another language.
Please look at the website now, I have recreated the original menu where the error occurs.
Once you click on the current language in the menu, give it some time and you will see that it simply reloads current page. It suppose to on the other hand open the language list selection.
Looking forward to your reply.
Best,
AlexApril 26, 2022 at 1:05 pm #1349534Hi,
Thank you for the clarification.
The submenu items are always visible the last time we checked the site, so we were not able to reproduce the issue. We checked it again today and got the same issue with the mobile menu language dropdown as you described.
You may need to keep the Menu Icon Submenu items settings to the first option to keep the submenu items visible, only until we find a proper solution.
Best regards,
IsmaelApril 27, 2022 at 6:18 pm #1349685Hi Ismael,
Just to clarify, are you saying that this is an incompatibility of the theme and WPML?
Should I in this case wait for an update?
Meanwhile keeping (Enfold > Main menu > Menu Icon submenu items > Always display submenu items) as this is where the setting for the first option was.
P.S. For some reason the WPML sandbox mode did not have this error. It seems to only appear on my installation of the theme, but even if I turn all plugins off and remove all custom CSS and Google tracking the issue is still there. So I wasn’t sure whether it was only me. Hope you checked on a mockup site from your side too.
Best,
AlexanderApril 28, 2022 at 8:17 am #1349759Hi,
Just to clarify, are you saying that this is an incompatibility of the theme and WPML?
Did you modify the language switcher? This is probably an issue with one of the theme scripts, which builds the mobile navigation based on the default menu. Please post the site details in the private field so that we can inspect the theme options and check the issue further.
Best regards,
IsmaelApril 28, 2022 at 9:16 am #1349773Hi Ismael,
Thank you very much for looking into the problem.
I have once hired a programmer who changed disabled some languages to appear on all pages but that has been removed (maybe not completely) can’t be 100% sure.
Site details attached in Private Content.
Thank you!
AlexMay 3, 2022 at 5:03 pm #1350359Hi Ismael,
Have you had a chance to look into the site yet?
Looking forward to hear from you.
Best,
AlexanderMay 7, 2022 at 6:46 pm #1350883Hi,
Thank you for your patience and for the link to your site,
I removed your Sprache: and Language: mobile menu placeholder items, and enabled Enfold Theme Options ▸ Main Menu ▸ Burger/Mobile Menu ▸ Clone title menu items to submenu and Enfold Theme Options ▸ Main Menu ▸ Burger/Mobile Menu ▸ Display submenu items on click
Then I added this function to your functions.phpfunction custom_mobile_wpml_dropdown() { ?> <script> (function($) { $('span.av-hamburger').on('click', function() { setTimeout(function() { $('#av-burger-menu-ul>.wpml-ls-menu-item>a').attr('href', '#'); $('html[lang="en-US"] #av-burger-menu-ul>.wpml-ls-menu-item.av-width-submenu.av-active-burger-items>a>.avia-menu-text>span').text('Language:').css({'margin-left':'0'}); $('html[lang="de-DE-formal"] #av-burger-menu-ul>.wpml-ls-menu-item>a>.avia-menu-text>span').text('Sprache:').css({'margin-left':'0'}); $('#av-burger-menu-ul>.wpml-ls-menu-item>a>.avia-menu-text>.wpml-ls-flag').css({'display':'none'}); }, 700); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_mobile_wpml_dropdown');
Now in both languages you have a drop-down menu with the language switchers for mobile.
Please check.Best regards,
MikeMay 10, 2022 at 11:41 am #1351145Dear Mike,
Sorry for not answering the message. Worked at an Expo over the weekend and could not reply.
First of all, everything works perfectly, just checked.
Second of all, thank you for making even more what was initially requested. The language placeholder was only there for the moment before the dropdown function was fixed. But it was the function that I actually needed and could not get it myself! That said, THANK YOU VERY MUCH for your help!!!
I think I will put Kreisi logo as an official partner at some point in time. Your team is great :)
Thank you!!!
Hope you have a good day.
P.S. if I would need to put an icon instead of the text (language), would that be possible and easily achievable? The icon code looks like this: [av_font_icon icon='ue821'].
Best,
AlexMay 10, 2022 at 1:05 pm #1351153Hi,
Glad to hear this is helped, to add the icon before the “language” text I added this css to the WordPress ▸ Customize ▸ Additional CSS field:#av-burger-menu-ul>.wpml-ls-menu-item>a>.avia-menu-text>.wpml-ls-native:before { content: "\e821"; font-family: "entypo-fontello"; font-size: 18pt; display: inline-block; margin-right: 0.3em; }
please clear your browser cache and check.
Best regards,
MikeMay 10, 2022 at 3:02 pm #1351173Hi Mike,
It just worked, but because I needed the other icon I tried to change it and now it doesn’t. [av_font_icon icon='ue8b1']
I also usually use different location for custom CSS Enfold > General Styling > Quick CSS. Would you say that WordPress > Customize > Additional CSS is a better because the custom CSS does not have to be duplicated for different language or why did you use it otherwise?
Best,
AlexMay 10, 2022 at 5:37 pm #1351205Hi,
I changed the css to thiscontent: "\e8b1";
the “U” has to be a backslash for it to work.
I only used WordPress > Customize > Additional CSS so I would not have to add the css to each language Quick CSS field, if you are happy with the results feel free to move the css to each language Quick CSS field.Best regards,
MikeMay 10, 2022 at 7:46 pm #1351269Hi Mike,
Thank you so much! I was wondering why doesn’t it work, had no idea about the U.
Quite frankly it seems like the whole CSS should be moved to WordPress > Customize > Additional CSS instead to decrease the size of CSS.
Again, thank you very much for your help and time. Really appreciate it!
Best,
AlexMay 11, 2022 at 12:40 am #1351293Hi,
Alright, I move the css for you, unless there is anything else we can help with on this issue, shall we close this then?Best regards,
MikeMay 11, 2022 at 9:12 am #1351306Hi Mike,
Yes you may close the thread.
Best,
Alex -
AuthorPosts
- The topic ‘WPML Language dropdown link glitch.’ is closed to new replies.