Archived topic
Dropdown Menu of Country Switcher in Header
42 replies · Started by Ree on July 24, 2021
Hi there,
the language plugin you're using should provide a shortcode.
you can use a Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
To add the shortcode.
And then set the Hook to generate_menu_bar_items
Hi I found out how to add the dropdown menu, however its not showing in my mobile menu.
I've added the functions in my child theme, and ticked mobile menu.
The code is showing up when I inspected though.
Hi there,
Can you clear and disable your caching plugin first?
Let me know :)
I don’t have caching plug-in activated and I tried incognito - not working …
Are you talking about the two flags that are currently added as the top bar widget?
No, not about that. I made a drop down menu which will only show on mobile but only the code is showing on inspect.
Sorry not sure if I'm following.
Are we still talking about the country switcher?
Yes we are talking about Country switcher in HEADER, not language switcher in Top Bar.
This is desktop showing the country switcher : https://prnt.sc/1fkep81
This is mobile showing nothing, although I’ve added the functions in my child theme, and ticked mobile menu. https://prnt.sc/1fkf4ma
Can you share a link to the site where we can 'see' the issue?
Yes the link is here
You will need to use the method i proposed here:
https://generatepress.com/forums/topic/dropdown-menu-of-country-switcher-in-header/#post-1869070
WPML has a code but that’s only for language switcher not country switcher.
Also my current struggle is to show the menu on mobile.
I’ve tried inserting the drop down menu using hook but the drop down ain’t working
Hi Ree,
Also my current struggle is to show the menu on mobile.
I’ve tried inserting the drop down menu using hook but the drop down ain’t working
Should the menu show up inside the off-canvas? or should it be added on the space indicated here? https://share.getcloudapp.com/7KuoDqNn
You can try these hooks for the mobile header- generate_inside_mobile_header or generate_after_mobile_header_menu_button