Ask your WordPress questions! Pay money and get answers fast! (more info)

"current-menu-item" > "sub-menu" to appear in div ? WordPress


Can anyone tell me how to display a "current-menu-item" with a "sub-menu" in a separate div?
What PHP will hook the active submenu only?

I want another horizontal menu bar to appear below main nav *only* when there is 2nd level nav

Here's my site's main-nav items that have sub-menus:

MEN | WOMEN | SUPPORTS (all product-categories) | MY ACCOUNT (page)

other 3 main-navs are simple pages with no subpages: PEOPLE | BIOMECHANICS | CONTACT

Heres the test site URL:

[[LINK href=""]][[/LINK]]

Heres the PHP from the header (this doesnt work) :

<div class="submenu-nav twelvecol last">
<h4 class="submenu"><?php wp_nav_menu( array('theme_location' => 'header-menu', 'current-menu-item.sub-menu' => 'child-menu', ) ); ?>
<h4 class="navlink"><?php posts_nav_link(); ?></h4>


Answers (2)


Arnav Joy answers:

i think you can do it via php also .

as in the menu i can see that your categories are hierarchical , so when you are at top level parent category page whose parent id is 0 , then and if that category has subchild then you can show another menu

let me know what is name of your taxonomy ?

tomDickson comments:

Thx for responding, AJ. Since the product-categories were set up by Jigshop (once I'd installed the plugin), believe the taxonomy-related pages are theirs also. I did not set up dedicated tax-pages; I designed the site orig with simple category pages and 3 dedicated submenus, then installed Jigoshop, and had to reconfigure everything to incorp their "product-category" and "my account" sales sub-pages.

I think it is probably simply called "jigoshop_product_taxonomy". Attached is a screenshot of the "product_taxonomy" file.