wp-bootstrap / wp-bootstrap-navwalker

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
https://wp-bootstrap.github.io/wp-bootstrap-navwalker/
GNU General Public License v3.0
3.37k stars 1.94k forks source link

Downdown On First Menu Item Only #45

Closed cyarema closed 11 years ago

cyarema commented 11 years ago

I tried to implement your menu dropdowns. However, the submenu appears only on first nav item. The dev site is here: http://dev.riverroadcoffees.com/ I've attached a screenshot of the wordpress menu. I've copied and pasted everything exactly from the main page. Any help would be appreciated. Thanks. screen shot 2013-10-23 at 11 59 39 am

*_EDIT_** ALL the dropdowns show when i'm logged into wordpress. However, when not logged in, the don't appear.

SideQuestDIY commented 11 years ago

Greetings @cyarema,

This is an interesting one as I can't say I have seen that before.

My first instinct was that there is a plugin conflict as I see by viewing the source there are two different versions jQuery loading, but after looking at the HTML it seems that the walker is not outputting the menu items at all. Very odd indeed.

Could you let me know:

Also, could you share the code of the file your menu is declared in (usually header.php)

cyarema commented 11 years ago

WP 3.6.1 // Jquery 1.10.1 (declared in footer) // Walker: Version: 2.0.4 Menu Code:

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                </div>

                <?php
                    wp_nav_menu( array(
                        'menu'              => 'primary',
                        'theme_location'    => 'primary',
                        'depth'             => 2,
                        'container'         => 'div',
                        'container_class'   => 'collapse navbar-collapse navbar-ex1-collapse',
                        'menu_class'        => 'nav navbar-nav',
                        'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                        'walker'            => new wp_bootstrap_navwalker())
                    );
                ?>
            </div>
        </nav>

I thought it was weird only working when logged into WP

claudiosanches commented 11 years ago

Remove the jQuery in the Footer! Already have WordPress jQuery on head.

cyarema commented 11 years ago

Nope that didn't do it . Thought it would be that easy.

claudiosanches commented 11 years ago

It's easier if you fix your site! Already have jQuery of the WordPress in the head. If you leave this jQuery in the footer will break with other plugins and many other things.

Simple as that. You're breaking everything!

claudiosanches commented 11 years ago

Ahh important detail there! You are using WooCommerce. And the menus "Change Password", "View Order" and "Edit My Address" works only logged!!!

Learn how to use WordPress and WooCommerce would be cool. Then of course to fix jQuery in your Footer!

cyarema commented 11 years ago

You are so right. Sorry, I hadn't made any real pages yet and was just working out bootstrap >> wordpress kinks.

SideQuestDIY commented 11 years ago

Haha, as a WooCommerce user myself I should have caught that! Thanks @claudiosmweb!