Get submenu based on curent page ID
-
Just a tip… I was looking to display the submenu based on the current page ID. All I had to do was change line #59 to output the items when I entered the current id as the “submenu” value.
was…
$cursor = $item->ID;
now…
$cursor = $item->menu_item_parent;
then called it using…
wp_nav_menu(array( 'menu' => 'header', 'submenu' => (string) $post->ID ));
Thanks for the time-saver!
https://www.ads-software.com/extend/plugins/wordpress-wp-nav-menu-filter/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get submenu based on curent page ID’ is closed to new replies.