Tag Info

New answers tagged


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" ...


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 ...


Each WP menu item that contains a submenu haves the "menu-item-has-children" class for <li> you can use that class for add a pointer for sub menu: For example the simple example can be this but you can use that for creating better pointer for your site: .menu > li.menu-item-has-children > a:after{ content: "(have child)"; }

Top 50 recent answers are included