Broken Mobile Nav?
-
When the Navigation responds to mobile, it does not enter the mobile Navigation drop down. How do I go about fixing that?
Thank-you
-
I am having the same issue! It shows the menu and the drop down image, but it does not work.
Same issue here on WP 3.9 and Aldehyde 1.0.9.
Looking at the Aldehyde Demo, the custom.js script is the exact same that has been deployed, as the headers.php which calls on wp_nav_menu() which generates the navigation bar. For some reason however, there is something different between the Demo and the WordPress call, as on my server, it’s putting in<br /> <div class="default-nav-wrapper col-md-8 col-xs-12"><br /> <nav id="site-navigation" class="main-navigation" role="navigation"><br /> <div id="nav-container"><br /> <h1 class="menu-toggle"></h1><br /> <div class="screen-reader-text skip-link"><a href="#content" title="Skip to content">Skip to content</a></div></p> <p> <div class="menu"> <ul><li class="current_page_item"><a href="http://redacted/">Home</a><li class="page_item page-item-2"><a href="http://redacted/blog/">Blog</a><li class="page_item page-item-5 page_item_has_children"><a href="http://redacted/test-page/">Test Page</a><ul class='children'><li class="page_item page-item-4"><a href="http://redacted/test-page/test-page/">Test Page</a></ul> <li class="page_item page-item-21"><a href="http://redacted/home/">The Main JOB!</a></div><br /> </div><br /> </nav><!-- #site-navigation --><br /> </div><br />Whilst on the Demo site, it’s got:
<br /> <div class="default-nav-wrapper col-md-8 col-xs-12"><br /> <nav id="site-navigation" class="main-navigation" role="navigation"><br /> <div id="nav-container"><br /> <h1 class="menu-toggle"></h1><br /> <div class="screen-reader-text skip-link"><a href="#content" title="Skip to content">Skip to content</a></div></p> <p> <div class="menu-menu-1-container"><ul id="menu-menu-1" class="menu"><li id="menu-item-8" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8"><a href="#">Dropdown Demo</a><br /> <ul class="sub-menu"><br /> <li id="menu-item-12" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-12"><a href="http://#">Level 1</a><br /> <ul class="sub-menu"><br /> <li id="menu-item-13" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13"><a href="#">Level 2</a></p> <p> <li id="menu-item-14" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14"><a href="#">Another Item</a></p> <p><li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="http://demo.inkhive.com/aldehyde/sample-page/">Page</a><br /> <li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10"><a href="http://inkhive.com">More Themes</a><br /> <li id="menu-item-11" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11"><a href="http://inkhive.com/product/aldehyde/">Download This Theme</a><br /> </div> </div><br /> </nav><!-- #site-navigation --><br /> </div><br /> </header><!-- #masthead --><br />If you look, the key difference is that the Demo includes id’s (which I don’t think to be of importance) but the classes are different. In the demo, it’s using
menu-itemwhilst on 3.9, it’spage_itemand so on.EDIT— I’ve had a play with the Aldehyde commands, and added a command to the generation of the nav-bar to change the class, but that doesn’t make any idfference. Any ideas?
EDIT 2— I *think* I’ve found exactly what is needed. In the
<ul>tag within nav, all it needs isclass="menu"and that resolves it.EDIT 3— Resolved: Go to the editor for Aldehyde, and under
header.php', change the line startingwp_nav_menu` with all the arguments to :
<code>
remove_all_actions( ‘wp_nav_menu_args’ );
remove_all_actions( ‘wp_nav_menu’ ); wp_nav_menu( array( ‘menu_class’ => ‘menu’, ‘theme_location’ => ‘primary’ ) );
</code>I’ve tested this and it appears to be working. Note, the
'menu_classis necessary to bring back the mobile interface. If you added custom code in the arguments, you’ll need to add these back in.Best
Rich
@richyjt:Thank you contributing to the forums but please do not encourage people to edit theme files directly. At best, they will lose all of their changes when they update the theme. At worst, they could bring their site down. They should be recommended to create a child theme or use a custom CSS plugin for their changes.
The topic ‘Broken Mobile Nav?’ is closed to new replies.
