Add the "Title Attribute" in the menu
-
Hi guys, i’ve a question about this code:
$menu_name = 'main_menu'; if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) { $menu = wp_get_nav_menu_object( $locations[ $menu_name ] ); $menu_items = wp_get_nav_menu_items($menu->term_id); $menu_list = '<ul id="nav">'; foreach ( (array) $menu_items as $key => $menu_item ) { $title = $menu_item->title; $url = $menu_item->url; $menu_list .= '<li><a title="' . $title . '" href="' . $url . '">' . $title . '<span>' . HERE COME THE TITLE ATTRIBUTE!!! . '</span></a></li>'; } $menu_list .= '</ul>'; } else { $menu_list = '<ul><li>Menu "' . $menu_name . '" not defined.</li></ul>'; } // $menu_list now ready to output echo ($menu_list);
How can i show the “Title Attribute” situated in the Menus into the Appearance?? Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add the "Title Attribute" in the menu’ is closed to new replies.