Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to access the name of menu in worpress

wp_get_nav_menu_name($location)
Comment

how to access the name of menu in worpress

$menu = wp_get_nav_menu_object("my mainmenu" );
Comment

how to access the name of menu in worpress

$menu = wp_get_nav_menu_object("my-mainmenu" );
Comment

how to access the name of menu in worpress

 Object (
   term_id => 4
   name => My Menu Name
   slug => my-menu-name
   term_group => 0
   term_taxonomy_id => 4
   taxonomy => nav_menu
   description => 
   parent => 0
   count => 6
 )
Comment

how to access the name of menu in worpress

echo $menu->name;
Comment

how to access the name of menu in worpress

$menu_location = 'header';

$menu_locations = get_nav_menu_locations();

$menu_object = (isset($menu_locations[$menu_location]) ? wp_get_nav_menu_object($menu_locations[$menu_location]) : null);

$menu_name = (isset($menu_object->name) ? $menu_object->name : '');

echo esc_html($menu_name);
Comment

how to access the name of menu in worpress

<?php $menu_name = 'sidebar-menu'; //menu slug or menu location
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
 
echo "<pre>";
print_r($menuitems);
echo "</pre>";
?>
Comment

PREVIOUS NEXT
Code Example
Php :: bsljeet 
Php :: Registering a variable with $_SESSION. 
Php :: how check word is in sentence php 
Php :: laravel length validation 
Php :: how to fix 419 page expired in laravel 
Php :: laravel validatrion check should be null 
Php :: dd function not laravel 
Php :: how to color php text 
Php :: symfony create form multiple entities 
Php :: auth guard (admin) is not defined laravel 8 
Php :: how to clear post array on referesh + not refill when return 
Php :: List all controllers in codeigniter HMVC structure 
Php :: laravel-filemanager 404 error 
Php :: on keyup jquery for search php 
Php :: WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403 
Php :: Customizing The Validation Attributes 
Php :: laravel helper functions 
Php :: session 
Php :: laravel make migration 
Php :: must return a relationship instance laravel 
Php :: Laravael Blog Project 
Php :: image not displaying in laravel 
Php :: get all weeks in month php 
Php :: how to validate phone number in php procedural programming 
Java :: round jframe corners in java 
Java :: spigot cancel repeating task 
Java :: find maven version 
Java :: springboot starter jpa 
Java :: processing string to int 
Java :: print list in java 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =