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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | - | - |
- | - | - | - | - | - | - |
Supporter timezone: Africa/Cairo (GMT+03:00)
Tagged: Custom Work, Feature request
This topic contains 14 replies, has 3 voices.
Last updated by George Botsev 1 year, 7 months ago.
Assisted by: Osama Mersal.
Author | Posts |
---|---|
October 19, 2023 at 12:25 pm | |
lesterf |
I am facing problems with widget shortcodethis is my website: hidden link (without https!!) I am using the widget shortcode and it does not work in my menu I dont know what else to do... The shortcode, if is added in the content... it is working super It is not the template and is not incompatibility with other plugins. I tried to use a different template and same problem |
October 19, 2023 at 1:01 pm | |
October 22, 2023 at 8:47 am #14630387 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, Thanks for contacting WPML forums support. First of all, sorry for the late reply due to a higher workload. I'm afraid the language switcher needs some custom code, which is not supported in this forum. Kindly check our support policy. (https://wpml.org/purchase/support-policy/) Please check our custom language switcher guide to know more about language switchers. (https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/) Best regards, |
October 23, 2023 at 1:32 pm #14638463 | |
lesterf |
Your shortcode does not work to load the language switcher in the menu. It's not a matter of whether it's in your policy or not, it's just that WPML doesn't work properly when I try to insert your shortcode in the top menu. I am not using any plugin to do that, I have activated the option that wordpress gives you to load content in the menu using shortcodes. WPML is not doing the job. IT DOES NOT WORK. The shortcode is working well if is loaded in a page or post but not in the menu. Is not my fault, is not something to be made by me using the custom code. It is WPML that is not doing the job. So please, give me a solution because right now you are not helping at all. All you do is to wriggle out of the issue so that you can't give me a solution. |
October 23, 2023 at 1:48 pm #14638883 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, I tested the shortcode, and it works correctly if you add it to a template or theme file. Please login to this sandbox site and add a menu language switcher shortcode. (hidden link) If the issue is replicable, please let me know how to reproduce it. Best regards, |
October 23, 2023 at 2:38 pm #14639333 | |
lesterf |
You should add this hook to your functions.php to activate shortcodes in menus (If you prefer, you can also use a plugin called "Shortcode in Menus" but it doesn't work either). /* ENABLE SHORTCODES MENU */ add_filter('wp_nav_menu_items', 'do_shortcode'); Once this is done, you must add a new menu item containing the shortcode: [wpml_language_selector_widget]. You will see that the language switcher does not work, it does not become visible. Something is wrong with WPML that doesn't allow you to insert the language switcher to the menu using the shortcode I have previously indicated. All you have done in your sandbox wordpress is activate the "Footer language switcher" option from WPML > Languages > Show language switcher in footer, you are not doing what I am asking you to do, unfortunately. Please check the image I have attached. As you can see, the shortcode shows everything correctly in the page content but in the menu the shortcode is not working. It neither works in my Divi template nor works in the base wordpress template. Thanks |
October 23, 2023 at 3:37 pm #14640001 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, I added the shortcode to using the WordPress editor, and it works correctly. (Kindly check this hidden link) It works as expected when adding it to the menu as a menu item description. (Kindly check this hidden link) When adding it as a navigation label, it also works correctly. (Kindly check this hidden link) However, it doesn't look good, and there are two empty rows because of the # link, but CSS or Javascript could fix this. Also, I tested adding the footer custom language switcher mentioned in this guide. (https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/) Please note that you need to edit the custom language switcher (WPML-> Languages-> Custom language switchers) in order to edit the switcher in the front end. Best regards, |
October 24, 2023 at 5:52 am #14642303 | |
lesterf |
Dear Osama... Are you serious? Do you really call that working properly? I dont need a floating language switcher as you added in the footer. I need a language switcher in the main top menu as I asked you multiple times. It is more than obvious that the shortcode in top menu it is not working as it should, even a blind man could see it but you are only focused on closing my case as soon as possible and getting a new "solved" case on your record. What's going on here, are you getting paid for solved cases or how is this going? I feel like you treat me like an idiot and don't want to help me. CAN ACCEPT THAT IT IS NOT WORKING PROPERLY AND CAN TRY TO FIND A SOLUTION? Thank you! |
October 24, 2023 at 6:01 am #14642329 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, I'm sorry that you feel that way. I'm talking about the functionality, not the design. The switcher in the WordPress editor and menu switches between languages as it should. I'll consult our 2nd tier support team regarding the menu switcher design and update you as soon as I get their reply. Thanks for your patience Best regards, |
October 24, 2023 at 7:06 am #14642711 | |
lesterf |
Thank you Osama. I greatly appreciate it. |
October 24, 2023 at 1:14 pm #14647965 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, Thanks for your patience. Our 2nd tier support team said that adding the language switcher via short can create issues because, by default, WordPress doesn't allow shortcodes in menus, and you need to adjust the code to compensate. The alternative is to use a custom language switcher code to create the switcher as you need. In the meantime, the shortcode issue is escalated to our dev team as a feature request. Sorry for the inconvenience. If you need further info, please let me know. Best regards, |
October 26, 2023 at 6:17 am #14666523 | |
lesterf |
So no immediate solution to a WPML problem. A vague promise that "it will be looked into, leaves me alone with a basic tutorial that provides no help to non-expert users. Interesting way to help. |
October 26, 2023 at 7:21 am #14666861 | |
Osama Mersal WPML Supporter since 02/2020
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+03:00) |
Hi, Thanks for your reply. WPML provides a menu language switcher, a footer language switcher, and adding a switcher using code. Please check the following guides. 1) https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/ You want a menu language switcher using a shortcode to have a specific design on your site, and this approach needs some coding. The shortcode in the menu issue has been escalated to our development team to check, but please note that WordPress, by default, doesn't allow shortcode in menus, so this is an edge case. Thanks for your understanding Best regards, |
October 27, 2023 at 7:07 am #14675391 | |
lesterf |
None of this helps me. Absolutely nothing. If I add a shortcode created by me, it workds perfectly fine!!!! /* Shortcode to display the year */ function ms_year_shortcode() Your shortcode doesn't work for a reason and even though I know it doesn't work, you don't help me at all. |
October 27, 2023 at 7:31 am #14675577 | |
lesterf |
This solution was provided 1 year ago: https://wpml.org/forums/topic/wanna-see-the-language-dropdown-list-on-this-menu/ In one year, wordpress has not touched the use of shortcodes in menus. Don't tell me that the use of shortcodes is a bit edgy because it's totally false. A year ago the solution worked and today it doesn't? This is your fault and you are not helping me. You have passed the problem to the developers, but until then what do I do? I have studied this solution: https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/ And it doesn't work for me, it doesn't work. It is not what I need to do. All it does is load a floating menu in the wp_footer position. Can you explain me how to load the language switcher in a menu? Can you tell me how to indicate a position in a menu? It doesn't make sense. You are wasting my time. THIS IS FRUSTRATING!!!!!!!!! |
The topic ‘[Feature Request] Language switcher shortcode does not work in menu’ is closed to new replies.