Removing 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'
. This will remove the ul: ‘items_wrap’ => ‘%3$s’
Otherwise this function will remove the div for you:
// Remove the DIV container from around WordPress menus add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' ); function my_wp_nav_menu_args( $args = '' ) { $args['container'] = false; return $args; } // function
Revisions
- August 1, 2012 @ 05:36:10 [Current Revision] by PeterLugg
- August 1, 2012 @ 05:32:16 by PeterLugg
No comments yet.