- This topic has 5 replies, 3 voices, and was last updated 6 months, 2 weeks ago by David.
September 11, 2022 at 4:18 pm #2339968VR
What’s the best way to add a secondary menu inline after the Primary Navigation + Navigation Search icon?
We used the code you provided here to move the Navigation Search icon to be inline with the Primary Navigation. Thanks!
Then we used a “Hook (generate_after_primary_menu)” Element to add a custom menu (“Main Menu Icons”) (with several social media icons) using this code in the Element:
`<?php wp_nav_menu( array( ‘menu’ => “Main Menu Icons” ) ); ?>
Is there a php code snippet we can use to ensure the social icons appear inline with the Main Menu + Search Icon? Right now, they wrap to a new line.
Thank youSeptember 11, 2022 at 7:40 pm #2340036Fernando Customer Support
One approach is to add them in one menu if you want them to wrap together.
Then, we can just alter the position through CSS.September 12, 2022 at 7:35 am #2340538VR
Thanks. We thought of that, but we felt it would be easier for the Client to manage them as separate menus (because they use funky looking SVG code in the “Name” field and might be confusing to them in the main menu). Also, we’d like the search icon to appear *before* the social icons.
If there is a way to get the search icon to appear before the social icons *AND* still retain it’s functionality to open a search area when clicked, then we’d be okay with that if you don’t think there’s a straightforward way to add it as a separate menu. Is there a code snippet or some other way we can ensure the search functionality stays intact even if the search icon is added directly as a menu item (instead of using the “Navigation Search” checkbox in the Customizer)?
Thank youSeptember 12, 2022 at 8:25 am #2340748DavidStaffCustomer Support
you can try the
generate_menu_bar_itemshook to add your social icons, as that will output inside the primary navigation after the menu / search icon.
Adding CSS: http://docs.generatepress.com/article/adding-css/September 15, 2022 at 7:13 am #2343728VR
Thank you. We used the hook you suggested. Also realized it was wrapping to a new line because the Main Menu itself was wrapping to a second line, so that pushed the social menu down to a third line. Once the menu tabs were adjusted to fit on one line, it works great. Thank you!September 15, 2022 at 8:57 am #2343989DavidStaffCustomer Support
Glad to hear that !
Adding CSS: http://docs.generatepress.com/article/adding-css/
- You must be logged in to reply to this topic.