jquery - Bootstrap, WordPress & NavWalker - Top Level Nav Links not working -


I know that this issue has been addressed in other postings, however, not working on top NAV link There is a problem.

This is a WordPress site built on Bootstrap 3 and is to integrate WordPress navigation into bootstrap structure. Here is the navigation code:

  & lt; Div class = "navbar navbar-default col-md-9" role = "navigation" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "navbar-header" & gt; & Lt; Button type = "button" class = "navbar-toggle short" data-toggle = "collapse" data-target = ". Navbar-collapse" & gt; & Lt; Span class = "sr-only" & gt; Toggle Navigation & lt; / Span & gt; & Lt; Span class = "icon-bar" & gt; & Lt; / Span & gt; & Lt; Span class = "icon-bar" & gt; & Lt; / Span & gt; & Lt; Span class = "icon-bar" & gt; & Lt; / Span & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt ;? Php wp_nav_menu (array ('menu' = & gt; 'primary', 'theme_space' = & gt; 'primary', 'depth' = & gt; 2, 'container' = & gt; 'div', 'container_class' = & Gt; Fall Navbar-Fall KO-MD-9 ',' Container_ID '= & gt; None,' menu-class = & gt; nav nav navbar-nav ',' fallback_cb '= & gt; Wp_bootstrap_navwalker :: fallback ', & gt;' walker '=> new wp_bootstrap_navwalker ())); ? & Gt; & Lt; / Div & gt; & Lt ;! - /.container - & gt; & Lt; / Div & gt; & Lt ;! - /.navbar - & gt;  

It is naturally lacking the hover feature which is good on the drop down menu, I have addressed it with the following solution:

  (function ($ } {JQuery (function ($) ($. 'Navbar .dropdown'). Hover (function () {$ (this'. 'Drop down menu'). First (). Stop (true, true). 250) .Sliddown ();}, function () {$ (this) .find ('. () (First) (). Stop (true, true) .delay (100) .slideUp ();}); $ ('.n Navbar .dropdown & gt; a'). Click (function () {location.href = This.href;})}};}) (jQuery);  
< P> This drop down No one does a great job of displaying the navigation brilliantly, but there is no active link on the parent menu item.

I have confirmed that parents actually have a navigation hierarchy with those children There are active links with carrying out, where they display the links correctly, so there is something that I can not remember and I can appreciate deep sight or see it

NavWalker is being designed this way. You need to edit wp_bootstrap_navwalker.php source code on # 85 .

Keep the parents href even if they have children

  if ($ args-> is a child & amp; $ Depth = == 0) {// $ ATT ['href'] = '#'; // old line $ atts ['href'] =! Empty ($ item- & gt; url)? $ Item- & gt; Url: ''; // new line $ ATT ['data Toggle'] = 'dropdown'; $ ATT ['class'] = 'dropdown toggle'; $ Ett ['area-happoup'] = 'true'; } And {$ atts ['href'] =! Empty ($ item- & gt; url)? $ Item- & gt; Url: ''; }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -