How to hide bootstrap drop down menu on second click in my nav bar?

i am using bootstrap in my WordPress custom theme but my navigation menu does not hide after I click it the second time. How to resolve the problem
I am using bootstrap 3.
Also I m using a walker for drop down menu here is my code

<?php // Loading WordPress Custom Menu
 wp_nav_menu( array(
    'container_class' => 'nav nav-pills navbar-collapse',
    'menu_class'      => 'nav navbar-nav',
    'menu_id'         => 'main-menu',
    'walker'  => new Cwd_wp_bootstrapwp_Walker_Nav_Menu()
 ) );
?>

Related posts

Leave a Reply

1 comment

  1. why dont you use jquery to hide and show the drop down menu>
    your drop down menu opens on class “open” so you might toggle the class as

    <script>
        $(".your_nav_bar_list_item_class").click(function(){
        $(".your_nav_bar_list_item_class").toggleClass("open");  
        }):
    </script>