Display a portion/ branch of the menu tree using wp_nav_menu()

This was still on my mind so I revisited it and put together this solution, that does not rely on context that much: add_filter( ‘wp_nav_menu_objects’, ‘submenu_limit’, 10, 2 ); function submenu_limit( $items, $args ) { if ( empty( $args->submenu ) ) { return $items; } $ids = wp_filter_object_list( $items, array( ‘title’ => $args->submenu ), ‘and’, … Read more