- This topic has 42 replies, 5 voices, and was last updated 2 years, 7 months ago by David.
-
AuthorPosts
-
July 26, 2021 at 5:32 am #1871269Ree
it should show up here https://share.getcloudapp.com/7KuoDqNn
I’ve added a hook, but how do I add the dropdown menu that i’ve created?
I tried to use generateblocks but there’s no menu in the elements.July 26, 2021 at 7:53 am #1871620DavidStaffCustomer SupportOk it doesn’t look like you’re using the Secondary Navigation.
If so, then try this1. Create a new Menu just for your Country Switcher and set its location to the Secondary Navigation.
2. Create a Hook Element for thegenerate_menu_bar_items
hook
2.1 Add this code to the Hook text area:<?php if ( function_exists( 'generate_secondary_navigation_position' ) ) { generate_secondary_navigation_position(); } ?>
2.1 Check Execute PHP.
3. Add the snippet and CSS provided here so the Secondary doesn’t switch to a hamburger on mobile:
https://docs.generatepress.com/article/disable-secondary-navigation-mobile-menu/
July 27, 2021 at 1:58 am #1872506ReeI couldn’t find the secondary navigation option to tick https://prnt.sc/1gjk53u
July 27, 2021 at 4:16 am #1872646DavidStaffCustomer SupportAah sorry – you need to enable the Secondary Navigation module in Appearance > GeneratePress
July 27, 2021 at 8:17 am #1873126Reehttps://prnt.sc/1gnqb4o
It showed up but alongside with a new hamburger menu…
It should show beside the “user” icon. I am using the hook locationgenerate_menu_bar_items
I’ve added both the functions and css:
add_action( 'wp_enqueue_scripts', 'generate_dequeue_secondary_nav_mobile', 999 ); function generate_dequeue_secondary_nav_mobile() { wp_dequeue_style( 'generate-secondary-nav-mobile' ); }
.secondary-navigation .menu-toggle { display: none; } @media(max-width: 768px) { .secondary-navigation { text-align: center !important; } .secondary-navigation ul { display: block; } .secondary-navigation .sf-menu>li { float: none; display: inline-block !important; } }
July 27, 2021 at 8:44 am #1873149DavidStaffCustomer SupportDo you still have the hook enabled ? As i don’t see the request for the Secondary nav inside the menu_bar_items
July 27, 2021 at 8:55 am #1873168ReeSorry was just doing some testing. I’ve enabled it back again.
July 27, 2021 at 10:14 am #1873269DavidStaffCustomer SupportNow add this CSS:
@media(max-width: 1024px) { #mobile-header .menu-toggle.secondary-menu-toggle { display: none; } #mobile-header .secondary-navigation ul { display: block !important; } .secondary-navigation { order: -1; } }
And you can set the colors for the Menu item in Customizer > Colors > Secondary Navigation
July 27, 2021 at 6:18 pm #1873659Reeits now showing two secondary navigation..
July 28, 2021 at 3:56 am #1874163DavidStaffCustomer SupportAnd the last thing ( fingers crossed ) – is to:
Customizer > Layout > Secondary Navigation – and set its Location to No Navigation.
July 28, 2021 at 4:03 am #1874171ReeThank you! it works, phew!
I am testing on mobile, one tap on the arrow – the dropdown menu show up. However on second tap on the arrow the menu didn’t close. Any fix for this?
July 28, 2021 at 5:35 am #1874286DavidStaffCustomer SupportTry changing the Customizer > Layout > Primary Navigation –. Navigation Dropdown to one of the Click options ( The secondary nav will use that setting )
July 28, 2021 at 6:08 am #1874346ReeThanks for the pointers David! Works like magic
July 28, 2021 at 6:16 am #1874368DavidStaffCustomer SupportAwesome – glad we got there 🙂
July 28, 2021 at 7:18 am #1874455Reea question about styling :
1. how to make sure same distance between icons
2. Globe dropdown background is white but I want it to blend into menu background. Tried to change in customizer > colors but it’s not working.
3. How to switch globe position with user icon? -
AuthorPosts
- You must be logged in to reply to this topic.