wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Downdown On First Menu Item Only

Open cyarema opened this issue 13 years ago • 8 comments

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.

cyarema avatar Oct 23 '13 17:10 cyarema

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:

  • The version number of the walker in use
  • Your version of wordpress

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

SideQuestDIY avatar Oct 23 '13 17:10 SideQuestDIY

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

cyarema avatar Oct 23 '13 18:10 cyarema

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

claudiosanches avatar Oct 23 '13 18:10 claudiosanches

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

cyarema avatar Oct 23 '13 18:10 cyarema

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 avatar Oct 23 '13 18:10 claudiosanches

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!

claudiosanches avatar Oct 23 '13 18:10 claudiosanches

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

cyarema avatar Oct 23 '13 19:10 cyarema

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

SideQuestDIY avatar Oct 23 '13 20:10 SideQuestDIY