Archived topic
Insert WPML switcher in Off canvas menu?
5 replies · Started by Henk on September 17, 2022
Hi,
Can you tell me what's the best practice to include the WPML language switcher in reponsive mode?
a) besides the hamburger
b) replace the search icon with the WPML-switcher
b) after clicking on the hamburger as the first menu item
And my next question will be: how can I show the WPML switcher at your advised location?
Best regards,
Henk.
Hi there,
i am not sure there is a best practice, it really is your preference.
options a) and b) can be achieved using a Hook Element, and adding the WPML shortcode, and selecting the generate_menu_bar_items_hook
option c) would be done by adding the WPML menu switcher item to the menu you assign to your off canvas.
Hi David,
Thanks for your reply, but unfortunately I can't get it working.
I made a generate_inside_mobile_header hook and included the shortcode [wpml_language_selector_widget].
When I inspect the code, the relevant WPML code is inserted (see screenshot).
But the icons are not shown, do I make somewhere a mistake or forget something to configure?
Screenshot: https://ibb.co/nC5qnJJ
Can you find what's wrong?
Thanks, Henk.
Hi Henk,
Try this CSS:
#mobile-header .wpml-ls-statics-shortcode_actions ul {
display: block;
}
Hi Ying,
Thanks, now it's working as expected.
Kind regards,
Henk.
You are welcome :)