WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WordPress wp nav menu Filter

Adds the ability to pass an argument (pageID or page name) to show a filtered submenu with wp_nav_menu().

What will happen if I pass an invalid page ID?

It defaults to the main menu, the same as if the plugin wasn't activated/installed.

How do I select a menu more than one level deep?

You can go multiple levels deep by putting slashes in:

wp_nav_menu(array(
  'menu' => 'header',
  'submenu' => 'Solutions/Company Solutions'
));

Or you can also use an Array:

wp_nav_menu(array(
  'menu' =>
  'submenu' => array('Solutions', 'Company Solutions')
));

Can I use a page's slug instead of the page title?

Currently, I see no reason to use a page slug. This functionality can be added at a later date if I see it to be necessary.

Does the title need to match exactly?

This plugin should compare the page title with what you entered and be slightly forgiving (Capital letters, etc), but you should strive to enter it exactly.

Example for inside template files:

wp_reset_query();  //Good practice to clear any of your custom loops before this code

wp_nav_menu(array(
  'menu' => 'header',
  'submenu' => ''.$post->ID.'' //This will always provide an exact match to the current loop page
));

Requires: 3.0.0 or higher
Compatible up to: 3.3.2
Last Updated: 2012-4-5
Downloads: 5,390

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,2,2
0,1,0