Tag Info

Hot answers tagged

2

Yes, you'll need to implement the walker class for this. Here is a simple example. $defaults = array( 'theme_location' => 'primary', 'container' => 'ul', 'menu_class' => 'nav navbar-nav main-nav', 'walker' => new Primary_Walker_Nav_Menu() ); wp_nav_menu( $defaults ); In the above block of ...


2

If you're only looking to change the outer elements (not the li's themselves) you can pass into wp_nav_menu() the 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>' argument and edit it as needed, for example this shows how to wrap the list in a nav element and a div element: 'items_wrap' => '<div><nav><ul id="%1$s" ...



Only top voted, non community-wiki answers of a minimum length are eligible