wp_nav_menu()
is irrelevant here. An Array is an Array regardless. But no, this won’t work. It will result in array that looks like this:
array(
'theme_location' => 'right',
array(
'container' => false,
'menu_class' => false,
'items_wrap' => '%3$s' // Removes <ul> and wraps <li>
),
)
To get the values in a single array you need to merge the arrays with array_merge()
:
// Left
$menu = array('container' => false, 'menu_class' => false, 'items_wrap' => '%3$s');
wp_nav_menu( array_merge(
array( 'theme_location' => 'left' ),
$menu
) );
// Right
wp_nav_menu( array_merge(
array( 'theme_location' => 'right' ),
$menu
) );
Related Posts:
- How to Hard Code Custom menu items
- Removing container from wp_nav_menu not working
- Check if page is in a certain menu
- How to stop mobile theme inheriting desktop navigation menu?
- Increase search results for Admin -> Appearance -> Menus -> Search (default is 10)
- Is it possible to add classes to list items in wp_nav_menu()?
- How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?
- How do I fix this error: Warning: invalid argument supplied for foreach()?
- Exclude one item from wp_list_pages( $args );
- Page not appearing in navigation bar
- Remove nav_menus from customizer using a theme
- Extend WordPress REST API to show slugs for menu items
- WordPress Custom Menu Widget Style
- Output menu navigation in php file
- Custom Post type menu highlighted in the archive/post
- display only the wp_nav_menu, which has the current-menu-item
- Unclickable Menu Item Label in Custom Menu with Clickable Children
- Add tabindex to navmenu
- wp_list_pages sort order is different for different languages [closed]
- Remove Metabox from Menus screen
- Sort wp_nav_menu() by menu order
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How can I add a link to a WPForms “contact us” form to the main menu?
- How to fix “Supplied nav_menu_item value missing property” after update to WordPress 5.0
- WordPress get or set active menu class
- Inserting additional into menu item text
- Missing Menus Structure
- switch_to_blog() and wp_nav_menu() not functioning properly
- Link to Homepage in Menu
- CSS for Created Menu “Active Selected” not working, everything else is!
- How to add ID attribute to each submenu?
- How do you link to a place in another page without any styling issues?
- Using a shortcode to create a dropdown menu from wp_nav_menu list items
- Determine the last child of the parent menu WP Nav Walker
- Edit menu parent element
- Navigation doesn’t render when wp is hosted
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- HTML list menu to WordPress menu
- Filter Menu Items by Custom User Role in a page
- Does is_child() exist in wp 3.5.1?
- Add “drop-down arrow” for menu items with sub-menus
- Cannot seem to replace the native menu with the menu I created, so 2 menus appear
- Add span in top menu item with nested itens
- Secondary Navigation Menudisappeared When using wp_nav_menu_items
- Add Labels to Admin Menu ( How To )
- Hide a menu on posts
- WP navigation list classes
- Can’t create a SubMenu
- Hamburger Menu not working on reduced browser size
- unable to add custom page/tab to my account woocommerce
- Add (grand)child pages automatically to nav menu
- Having trouble adding CSS class through menu to link
- Switch an entire nav menu if user is logged in
- Pull Menu Items Into an HTML element
- WordPress functions.php does not affect the theme menus
- How to pass menu slug as a variable to wp_nav_menu?
- New Menu Item Type Meta Box
- Using Different wp_nav_menu theme_location based on page id (or a parent id)
- Display Menu Navigation Label
- Drop Down menu expanded by default (on front page) [closed]
- Dynamically get the meta key value of a menu item based on it’s post ID
- Does this function wp_get_nav_menu_object check if a nav menu exists or is supported?
- Wrap wp_nav_menu output around option tags for select menu
- How to get current pages menu text?
- Search form as list item in menu?
- Catagorized hierarchy menu for PAGES!
- Most allowed Taxonomies in Appearance->Menus
- wp_nav_menu removing containing UL with ‘items_wrap’ => ‘%3$s’ not working
- Option to create menu is missing
- New menu is not showing in api response
- Newly created header is not visible on website
- Event listener callback returns undefined element
- Copied site has wrong menu URL behaviour
- Add CSS Class to WordPress Menu Item Dependent on the Page the User is Visiting
- Menu walker: how to tell if a sub menu contains submenus?
- Sub Menus will not work
- How do i make a custom top level dashboard menu item available for all users?
- Walker or wp_get_nav_menu_items VS jQuery
- I can’t correctly display menu
- Is it possible to seperate wordpress menu by different div?
- Primery Menu Configuration problem
- Disappearing items in menu
- Menu not saving in dashboard
- Menus not showing in the admin menu, after save
- Where these arguments are defined?
- How do i keep my current page menu highlighted on pagination?
- Add Protocol to Custom Menus
- WordPress Flyout Menus
- Pick out specific menu item from code
- Show All Children of WordPress Menu
- menu doesn’t show in different languages
- How to make an anchored page in a navigation menu tab
- Change menu item order
- Menu System: Custom Links
- highlight parent page on menu when child page is on sidebar (and not on menu)
- nav tag wrapping around dropdown
- Resolve the debugs
- Formatting WordPress Menus (without bullets, inline with text)
- child theme font awesome icons not working
- How to replicate a mobile menu from a site to a wordpress site [closed]