0

For one of my projects I'm trying to add a nav_menu to my WP theme. It should work as a quick menu (sidebar). The only problem remaining: How do I add a role="menu" to the < ul >?

    <?php
        wp_nav_menu( array(
            'menu'              => 'menu',
            'theme_location'    => 'menu',
            'depth'             => 0,
            'container'         => '',
            'menu_class'        => 'dropdown-menu',
            'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
            'walker'            => new wp_bootstrap_navwalker())
        );
    ?>  

I'm looking for the output <ul class="dropdown-menu" role="menu"> anyone ?

  • 1
    We highly encourage users to answer their own questions. You can accept it as solution two days later. Thanks. – kaiser Jul 10 '14 at 10:36
0

[Update] Solution found:

I was looking for 'items_wrap' => '<ul id="%1$s" class="%2$s" role="menu" >%3$s</ul>'

    <?php
        wp_nav_menu( array(
            'menu'              => 'menu',
            'theme_location'    => 'menu',
            'items_wrap' => '<ul id="%1$s" class="%2$s" role="menu" >%3$s</ul>',
            'depth'             => 0,
            'container'         => '',
            'menu_class'        => 'dropdown-menu',
            'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
            'walker'            => new wp_bootstrap_navwalker())
        );
    ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.