Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get shared menu from the main site displayed anywhere in the WordPress Multisite network
//Get $blog_id to remember where we currently are
global $blog_id;
$current_blog_id = $blog_id;
//switch to the main site which has id of 1
//Check if menu exists (regardless location)
if (wp_nav_menu(array('menu' => 'social-links'))):
//output the WordPress navigation menu, use slug/name/id
wp_nav_menu( array( 'menu' => 'social-links') );
//switch back to the current blog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.