Remove wrapping div and ul from output of wp_nav_menu

I am using the new menu system of WordPress, and here is the result of wp_nav_menu() <div class=”menu-main-menu-container”> <ul id=”menu-main-menu” class=”menu”> <li id=”menu-item-28″ class=”menu-item menu-item-type-post_type current-menu-item page_item page-item-21 current_page_item menu-item-28″><a href=”http://www.bemang.com/”>Trang nhà</a></li> <li id=”menu-item-29″ class=”menu-item menu-item-type-post_type menu-item-29″><a href=”http://www.bemang.com/blog/”>Blog</a></li> <li id=”menu-item-30″ class=”menu-item menu-item-type-post_type menu-item-30″><a href=”http://www.bemang.com/gioi-thieu/”>Giới thiệu</a></li> </ul> </div> What I want is only this: <li id=”menu-item-28″ … Read more

Add ‘has_children’ class to parent li when modifying Walker_Nav_Menu

I’m writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be: <li class=”has_children [other-wordpress-classes]”> <a class=”parent-link”>Some item</a> <ul class=”sub-menu”> I know how to add and remove the classes fine, I just cant find anything to tell me if … Read more

Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?

(Moderators note: Was originally titled “wp_nav_menu Ancestor class without children in navigation structure”) I have a wp_nav_menu in my header which had three pages in it. When I am on one of those pages, the li containing that page in the menu gets the class .current_page_item. These three pages have templates, and these templates contain … Read more