• I have recently started learning how to use WordPress, and I have selected a simple theme and want to implement the bootstrap navbar fixed-top menu.

    I have so far succeed, and have the menu working when the screen is in full mode, and loads in the correct primary menu. However, I need help with a couple things… firstly, I have the navbar set so when you hover over a Dropdown, it auto dropdowns the sub menu, but I would like the parent link to be clickable to it’s relevant page also. In standard HTML & CSS, this is simple to do, but in WordPress, when you load in the menu it’s a bit more complex (at least for me)… Here is how I have input the navbar within the header.php file:

    <div class="navbar navbar-inverse navbar-fixed-top">
        <?php
    // Fix menu overlap bug..
    if ( is_admin_bar_showing() ) echo '<div style="min-height: 28px;"></div>';
    ?>
        <div class="container">
        <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="/"><?php echo esc_attr( get_bloginfo( 'name' ) ); ?></a>
        </div>
        <?php
        wp_nav_menu( array(
        'menu'              => 'primary-menu',
        'theme_location'    => 'primary-menu',
        'depth'             => 2,
        'container'         => 'div',
        'container_class'   => 'navbar-collapse collapse',
        'container_id'      => 'bs-example-navbar-collapse-1',
        'menu_class'        => 'nav navbar-nav',
        'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
        'walker'            => new wp_bootstrap_navwalker())
        );
        ?>
        </div>
    </div>

    As you can see that the primary menu is loaded in with some PHP. The issue with this is, it does not allow for me to change the a class=”” on a Link so I can input ‘disable’, so it can be clicked as a Link. Also the Link is currently ‘#’ which I cannot change.

    Lastly, when I reduce my browser to check the menu response, when the toggle button displays, I click that and it shows the links, once I hover over the link with a sub menu it again auto drops down (which is not what I want when the responsive toggle menu is displayed). I want to click the link when the menu is shrunk down, rather than auto dropdown on full view.

    If anyone has any ideas on the above, I would greatly appreciate any advice.

    Thank you.

  • The topic ‘[Theme: Illdy] Bootstrap menu issues…’ is closed to new replies.