WordPress.org

Support

Support » How-To and Troubleshooting » Bootstrap 3 & Walker nav collapse problem

Bootstrap 3 & Walker nav collapse problem

  • This is my first try with integrating the bootstrap nav with wordpress using walker. I have it working with one exception and after 2 days of messing with it I need to ask for help before I’m completely bald.

    http://firehouseservices.com/a3k/automated-marketing/

    The first link has a dropdown on hover (the others don’t have children so there is nothing under them). The problem is that when the nav collapses and you see the “menu” button .. click the menu button and it doesn’t expand .. it doesn’t do anything. Any wise words on how to fix this?

    <script>
     $(function() {
    
    $('ul.nav li.dropdown').hover(function() {
        $('.dropdown-menu', this).fadeIn('fast');
    }, function() {
        $('.dropdown-menu', this).fadeOut('fast');
    });
    
        });
    </script>
    
       <nav role="navigation" class="navbar navbar-default">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
                    <span class="sr-only">Toggle navigation</span>Menu
                </button>
            </div>
            <!-- Collection of nav links and other content for toggling -->
            <div id="navbarCollapse" class="collapse navbar-collapse">
                <?php
    			wp_nav_menu( array(
    				'menu'       => 'top_menu',
    				'depth'      => 2,
    				'container'  => false,
    				'menu_class' => 'nav navbar-nav',
    				'fallback_cb' => 'wp_page_menu',
    				'walker' => new wp_bootstrap_navwalker())
    			);
    		?>
            </div>
        </nav>

    And in my functions.php

    require_once( get_template_directory()  . '/lib/navwalker.php');
    
    require_once( get_template_directory()  . '/lib/mobile-navwalker.php');

    I have also tried loading diff versions of jquery different ways and bootstrap different ways. Alas, nothing seems to fix the problem. I’m hoping its just a css thing. ANY help would be appreciated.

    [Moderator Note: No bumping, thank you.]

  • The topic ‘Bootstrap 3 & Walker nav collapse problem’ is closed to new replies.