Adds the ability to pass an argument (pageID or page name) to show a filtered submenu with wp_nav_menu().
It defaults to the main menu, the same as if the plugin wasn't activated/installed.
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') ));
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.
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.9.14
Last Updated: 2 years ago
Active Installs: 1,000+
Got something to say? Need help?