Skip to content

Instantly share code, notes, and snippets.

@rrennick
Last active Jul 11, 2016
Embed
What would you like to do?
Add global menu using network-wide-menu
<?php
/*
register the menu across the network
*/
register_nav_menu( 'global', 'Global Navigation Menu' );
/*
remove the menu from the menu screen on sub sites to avoid confusing users
*/
add_action( 'admin_init', 'global_nav_menu_init' );
function global_nav_menu_init(){
if ( ! is_main_site() )
unregister_nav_menu( 'global' );
}
<div class="global-nav-menu">
<?php
wp_nav_menu( 'global' );
?>
</div><!-- global-nav-menu -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment