I do this quite often, actually, if I’m understanding your issue correctly. If you use Appearance > menus, and create your navigation (with dropdown/children), then pull in the Custom Menu widget into the sidebar, you can use CSS to handle the rest.
Basically, you just set the main navigation in the header to how the regular list items, but hide the children. Something like:
#header .menu li li {
display:none;
}
That will show the main links in the header, but hide the dropdowns.
Because you’re pulling the same menu into the sidebar via the widget, the classes you need to highlight the menu items (for the current page you’re on) are already set – all you have to do it style them.
Related Posts:
- Keeping parent menu items active in child pages
- How to target children of child pages
- Schedule Page to Menu [duplicate]
- Programmatically add existing pages and subpages to Appearance Menu
- How to retrieve parent menu item name of current submenu item
- Weird behaviour on Edit Menus screen
- Listing Child Pages in a Certain Order?
- Active Menu Highlighter with Subpages?
- How to highlight 1st level menu item based on actual page
- Dynamic menu wp_list_pages displaying only current branch including: current page, his siblings and its childs
- Parent Page > Child Page Menu
- How to use wp_list_pages on a grandparent page
- Creating navigation out of specific IDs and their children?
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- Showing main menu and child menu in diffent places in a same page
- How can I structure my pseudo footer nav code with wordpress codex code?
- Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()
- Is there an easy way to replace a custom menu link with a page or post?
- Why do Custom Nav Menus generate so many classes on list items? Can I manage this somehow?
- Using nonce in menu item
- remove last separator?
- How show sub menu only using wp_nav_menu()
- Custom Nav Walker menu – Display children count
- How to add menu to Dashboard that can be viewed by all users
- WordPress Export Import Site Navigation Menu
- List children of second level sub page
- Show top-level parent with submenu menu walker
- Custom menus created but does not show up in admin panel
- Replace menu tag with tag
- How to display custom post meta in the appearance->menus page
- wp_nav_menu custom walker – child items
- Adding menu items dynamically using wp_nav_menu_objects
- BuddyPress – How to add logout in nav menu
- Where do custom menus get constructed?
- How to remove div container in custom menu?
- Get admin menu link
- How can I access the menu ID of an element in a WordPress Nav_Walker
- How to translate menu items?
- echo same menu items across multi-site platform
- Custom Menu url is Empty
- Menus don’t appear in admin area / WordPress Multisite
- WordPress menu not loading in the admin side appearence-> menu tab
- wp_nav_menu() doesn’t work
- Insert other menus as submenus of a main menu
- Change the menu home link to something else
- Make a navigation menu in the same post [duplicate]
- wp_nav_menu $theme_location parameter ignored
- Count within foreach loop
- How to create a menu with pages and post categories?
- remove specific classes from menu items
- Highlight parent if item from submenu is active
- Why Isn’t My WP_Nav_Menu returning false?
- changing host.. data loss
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- How to avoid a duplicate query from using wp_nav_menu?
- Wrapping menu’s top-level link and sub-menus in div
- how avoid the link of the current post in the menu in the sidebar?
- wp_bootstrap_navwalker Fatal Error
- wp_nav_menu returns false even though a menu is assigned to it
- How to change the menu mark up with walker_nav_menu class?
- Menu on mobile version doesn’t collapse after choosing menu item [closed]
- How can I query all available public post types and taxonomies?
- If test for “has_nav_menu()” does not return echo when no menu exists
- Opening Menu link in another tab
- Page header menu links change
- Is it possible to link to the same page from wordpress page menu?
- How do I add 3rd level of dropdowns to wp_nav_menu array?
- insert div into a menu item before the link and more
- How to remove empty menu space when creating admin page without menu title using add_submenu_page
- Trying to add Newline in Menu item
- How to unlock menu editing
- How to add a taxonomy type in Menus?
- WordPress + Bootstrap: Replace primary navigation menu on mobile?
- Multisite Setup – Menu Items To Reference Pages in Different Subdomains
- changin the url (permalink as it goes these days) on one specific menu layer
- Admin: WooCommerce Navigation Menus do not show empty categories search tab
- Using Anchor Link In Nav Menu
- WordPress database issues – menu not saving correctly, media thumbnails not showing
- How do I create a new directory to hold the assets for a new menu item?
- How to set active class to the menu of any page coming from a single.php template
- Sum root term’s entries count from child terms count
- Add newsletter signup element to navigation bar
- All custom links suddenly lack href attributes
- WordPress – Apperance > Menu
- Change archive link to single post
- Remove from wp_nav_menu() wordpress
- How do I add a link to the menu that has a charector (?) in it?
- Problem with custom menus
- Styling Active Links Within WordPress
- Make title bar collapse when scrolling
- how to show a custom taxonomy as dropdown in wordpress?
- Problem to asign class to with wp_nav_menu()
- Changing color of specific tab of top menu
- how to add fa fa icons customize menu using wp_nav_menu function?
- Navigation menu, remove item from desktop
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Wrapping my ‘s with
- Active Navigation Class Based on URL on icon
- Rename Menu icon in Twenty seventeen theme
- WordPress Menu – Adding a new dynamic element to the menu