You can not get the menu title using wp_nav_menu()
, you need to get the menu object as follow:
//Change with the ID of your menu
$menu_ID = 5;
$nav_menu = wp_get_nav_menu_object( $menu_ID );
// then echo the name of the menu
echo $nav_menu->name;
With the above code, you can insert the menu name in wp_nav_menu()
using items_wrap
parameter. For example:
$menu_ID = 5;
$nav_menu = wp_get_nav_menu_object( $menu_ID );
wp_nav_menu( array(
'theme_location' => 'resources',
'container' => 'div',
'container_class' => 'rmm-footer',
'items_wrap' => '<ul><li id="item-id">'.$nav_menu->name.'</li>%3$s</ul>'
)
);
Related Posts:
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Unregister Nav Menu from Child-Theme
- Call custom field into menu item
- Exclude Private, Draft pages from Primary Nav when using custom menu
- Automatically remove trashed pages from nav menu
- Pulling Featured Images in to a WordPress Menu
- wp_nav_menu always falls back to a menu
- wp_get_nav_menu_items how to exclude sub level menu items?
- Menu Disappears on Category Pages
- Overriding wp_nav_menu default arguments
- How to drag multiple menu items at once in WordPress?
- Customizing the a tag with Semantic UI
- Not able to get current menu ID
- wp_get_nav_menu_items order doesn’t work
- How to implement my own icons instead of using the svg icon system
- wp_nav_menu (secondary menu) not adding current classes
- WordPress wp_nav_menu with a nav tag
- WP /wp-admin/admin-ajax.php produces 404
- `start_el` depth argument in custom nav walker always evaluates to zero
- Programmatically set current-menu-item using wp_nav_menu
- WordPress Split Menu
- Custom Admin Menu Order
- How to set classname for tag in wordpress menu?
- Get number of root elements in walker class
- Operable default menu *and* custom 3 menu
- How to create this Custom Walker Menu
- create a 2 row menu in wordpress
- Get menu item by name or slug
- current-menu-item class is not added
- Change sub-menu contents of main menu
- wp_page_menu not working right?
- using OOP approach to create plugin but stuck at making hyperlinks to work
- creating a custom walker class
- Adding existing links to custom navigation menus?
- Add Buddypress profile and messages link to WordPress menu [closed]
- Use wp_logout_url() in menu creation page
- Is it possible to add a dynamic link in the main navigation in a child theme
- How to change menu structure?
- Insert a div class inside wordpress menu
- wp_nav_menu check both hierarchy fail?
- Edit the (automatic) HTML layout of nav menus
- How to make wordpress nav menu use post custom meta data
- Is it possible to make the heading on a page different text to the text of the menu item?
- How to Structure Pages and Subpages
- Add custom path to url to specific pages
- CTA button that is only visible to some of my users
- How do add a menu with levels within page [closed]
- Hide menu item when users are logged in/out
- add another html tag after li element in wp_nav_menu
- How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)
- menu-item class missing on wordpress menu
- How to add scroll IDs to WordPress menu anchors
- WP nav menu + Bootstrap, add role=”menu” to UL
- Active class to current link
- Making pages in a menu appear conditionally
- Modify the output of wp_nav_menu in a very specific way?
- Display pictures instead of text in menus
- how to check if given page is active page
- how to set the link in wordpress such that on clicking it doesn’t open another page but go to the bottom of same page
- custom walker class for own menu?
- WordPress Menu – creating a fake link [closed]
- Add a menu metabox to post edit page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- New wp menu menu styling
- (Mobile) Hamburger menu disappeared from a page (only one)
- How to add an archive page to WordPress menus (nav_menu)?
- Add div content to my already existing menu
- Hiding menu on specific pages
- Bootstrap Menu bar shows up a toggle in Desktop Mode
- For a menu custom link (without a link) a “#” is appended. Can this just be blank, i.e. NO link?
- sidebar navigation problem with child pages not all display.?
- How to point menu to my homepage
- save_post() on Menu Save
- dot.com/car1 does work, but dot.com/transport/car1 doesn’t work
- code to add an extra selection to the menu editor
- update_post_meta breaking wp_update_nav_menu_item
- Building a menu from a large number of pages?
- Dashicons not showed for admin menu
- How to select particular menu position in wordpress?
- Menus not visible in Appearance after being registered
- Cannot add home page url to menu with #
- Accidental reverse order of menu items in one menu
- Add dynamic content block to nav section generated by custom walker
- Customizing label/title output of admin nav_menu selecter
- Extend Individual Menu on Page Function to individual Submenue on Page Function?
- How do I remove a menu from a theme?
- Access CSS Classes specified in Menu options
- How can I modify wp_nav_menu with walker?
- menu items outside of blog
- Walker for menus
- Custom Menu based off custom header
- Change sub-menu css class
- How to add an tag when a menu item is a dropdown(or has a sub-menu) [duplicate]
- Remove “Next Post” in nav_menu
- Adding an additional menu in WordPress
- Making current_page_item work with wp_list_pages in sidebar on post pages
- Menu not Showing on Mobile or While the page is shrinked
- My Menu Disappears on my Custom Link Homepage on Mobile
- Add A Menu Item To A WP_Nav_Menu Navigation via PHP Function
- WordPress removes URL parameters from menu elements when saving the menu