1

Using Bootstrap 3 and Navbar Walker I am able to create dynamic dropdown on the Bootstrap and WP template but I need to add .dropdown-menu-left to the .dropdown-menu class, as well.

As you can see I tried this by addig this line

'dropdown_class'    => 'dropdown-menu dropdown-menu-left',

to the original code but apparently it is not functioning correctly.

    <?php
        wp_nav_menu( array(
            'menu'              => 'desktop-main-menu',
            'theme_location'    => 'desktop-main-menu',
            'depth'             => 2,
            'container'         => 'div',
            'container_class'   => 'collapse navbar-collapse',
            'container_id'      => 'desktop-navbar-main-collapse',
            'menu_class'        => 'nav navbar-nav navbar-right',
            'dropdown_class'    => 'dropdown-menu dropdown-menu-left',
            'fallback_cb'       => 'WP_Bootstrap_Navwalker::fallback',
            'walker'            => new WP_Bootstrap_Navwalker())
        );
    ?>

can you please let me know how I can add the .dropdown-menu-left ul?

  • dropdown_class is not a native attribute, and must depend on your walker class. – birgire May 4 '17 at 9:20

Your Answer

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

Browse other questions tagged or ask your own question.