-
YEAR93
I created a GeneratePress element called WPML Language Switcher with a shortcode for a custom WPML language switcher. I want to display it in the header on tablet and mobile.
I used the
before_navigationhook, but it still shows after the hamburger menu icon. I want it to appear before the hamburger icon, as shown in screenshot 2. In screenshot 1 you can see the current state.Can you help me position it correctly?
-
Hi there,
Try using
menu_bar_itemshook instead. -
YEAR93
I changed the hook to the one you suggested (
menu_bar_items). However, after updating it, the element is no longer visible on the front end.When I checked the source code, I noticed that the
.menu-bar-items<div>hasdisplay: none. If I manually change it todisplay: block, the WPML language switcher appears in the correct position but then both the menu label and the hamburger icon are displayed twice.How can this be fixed? View attached screen recording for reference.
-
The menu_bar_items hook should not be set to display:none by default, based on what I see, it’s been set to
display:flex:
https://app.screencast.com/9Yp4VgOFpeWONHowever, the language switcher has been set to display none as it has
ultag.So you will need this css:
.inside-header .menu-bar-items .wpml-ls ul { display: block; } -
YEAR93
This fixed everything.
Looks exactly how I wanted now. Thank you!
-
You are welcome 🙂
- You must be logged in to reply to this topic.