problem with menu
-
hi, plz help me with menu. I want to create menu with table but default is ul/li. i read codex and find fucntions which build menu.
$menu = wp_get_nav_menu_object( $locations[ 'Primary' ] ); $menu_items = wp_get_nav_menu_items($menu->term_id); $menu_list = '<table width="700px" id="menu-' . $menu_name . '"><tr>'; foreach ( (array) $menu_items as $key => $menu_item ) { $title = $menu_item->title; $url = $menu_item->url; $menu_list .= '<td><a href="' . $url . '">' . $title . '</a></td>'; } $menu_list .= '</tr></table>'; echo $menu_list;
but its not work. i dont know who get $menu->term_id, but if i use this code
wp_nav_menu( array('echo'=>'false', 'sort_column' => 'menu_order', 'container_class' => 'menu', 'theme_location' => 'Primary' ));
it is work. Have u any idea how do it ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘problem with menu’ is closed to new replies.