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" 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>
No, wrapping div or ul, I have been trying to few ways and google around but no result 🙁
The wrapping div is easy. When you use wp_nav_menu()
, add this argument: 'container' => false
For the <ul>
element, there’s an argument called 'items_wrap'
. See woodchucky’s answer for more info on that one (and upvote it!).