I am using twenty thirteen theme. I am using wp_nav_menu to display menu items. I need to remove the container div and ul from wp nav menu. I tried this.
wp_nav_menu( array( 'container' => '', 'items_wrap' => '%3$s', 'theme_location' => 'primary' ) );
But it’s not working. How to fix this?
add
false
forcontainer
Even this question is quite old, I want to add a working solution. I found this question while searching for exactly the same, but the answer from Mark just removes the container not the ul or li tags of
wp_nav_menu
.Remove all
<ul>
and<li>
tags fromwp_nav_menu
:Just place that in the function.php of your theme. But before doing so, always consider to solve this with CSS before.
Below code in
functions.php
Inside
header.php
, write the following code: