I worked it out.
I didn’t enter the correct hook. Here is the code that works for a genesis framework site.
add_action('genesis_after_header', 'primary_library_menu_switch');
function primary_library_menu_switch() {
global $blog_id;
if ( ! is_multisite() || 2 == $blog_id ) {
switch_to_blog( 1 );
wp_nav_menu( array(
'menu' => 2,
'fallback_cb' => false,
'menu_class' => 'genesis-nav-menu',
'theme_location' => 'primary'
) );
restore_current_blog();
}
}
Related Posts:
- Navigation menu not being assigned Theme Location
- Site admin in a network install can’t edit users?
- Multisite Domain Mapping with SSL
- WP-Admin not working properly at WordPress multisite with subdirectories
- Multisite – Keep users logged in only to their site
- Multisite – sub-subfolders for certain blogs
- Multisite behind Varnish
- How do I know if a user has a blog in WordPress Multisite?
- Multisite with Different Domains
- Weird Issue with load balanced WP 3.0 setup
- Configure WordPress to read from database only, never write
- How does WordPress connect sites and the wp_users table?
- How to migrate WordPress Blogs into Multisite without using the GUI-Import/Export Feature
- WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
- Suppress subdirectory from WordPress Multisite primary URL
- Copy posts from one blog to another in multisite environment
- Child Theme CSS Not Overriding Parent Theme In MultiSite Site
- Has anyone experience w/ WordPress (MultiSite) hidden users (possibly hacked)?
- Why wordpress multisite redirect to wp-signup if site exists?
- Is the W3 Total Cache plugin a good choice for WordPress MultiSite? [closed]
- How To Remove Dashboard Menu Items for Multisite Users?
- Is it possible to import a wordpress backup from a single site in to a multi-site configuration?
- Multiple domains with different child themes on one installation?
- Staging setup for multisite installation
- Redirect users on logout
- Multisite: I have a gap in my blogs. How to add the missing one?
- Create rewriterules for different domains in htaccess file with WP multisite
- Force Load https WordPress Plugins
- Free Google Analytics plugin that works with WordPress in network mode (WPMU)? [closed]
- How Access Multiple WordPress sites with a single login
- Adding an existing subfolder site to a fresh multisite in the root, would it cause a problem?
- Aggregate multisite RSS and restrict certain content
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- How to force change Network site multi language subdirectory base URL?
- Create subdomain out of sight the wp multisite
- Can i import a site (plugins, database, images) etc. Into an existing wordpress multisite?
- WordPress Multisite + Erros with URLS and ADMIN
- Importing XML didn’t finish, site is now inaccessible
- WordPress multisite – Bitnami
- How can I tell if a wordpress site is running on multisite?
- Adding hreflang to multisite with no plugin?
- Obtaining user table for one site on multisite set up
- One blog inside another
- Change Default WordPress MU Blog
- wordpress multisite permalink structure: mostly subdomains but not all
- possible to combine sites that have lots of content, into multisite?
- Bulk Move Users from one site to another within a network ( Multisite )
- Does a single theme license work on multisite? [closed]
- Multisite – getting a 404 for additional site created using subdomain install
- muliple wordpress multisite installs on the same sever
- WP Multisite – Additional subdomain on the site for API purposes
- how to create wordpress network with multiple wordpress installations
- get_last_updated() not working – multisite loop
- Multiple sites with independent users
- Programmatically creating site in a network
- What happens when someone goes to the root URL in WordPress Multisite?
- Migrate single site to Multisites with plugins, cPanel and already working subdomains
- Multisite configuration for multiple domains
- how to install wordpress HyperDB
- Multisite Redirect for Home Page Only
- 404 not working on main site on multisite
- Is it possible to create /sub/sub domain based multiste?
- add_blog_option blog ID
- How long is “as long as possible” in wp_cache_set()?
- How to add a menu that belongs to parent blog to all child-blogs?
- Cannot see dropdown shortcut to site dashboard in WordPress network why?
- How can I install WordPress as blog provider , stable?
- Automatic creation of mutisite blog outside of the admin
- List all sites created in network and get the language used for each site
- Automatically add a registered user on the wordpress multisite network even to just one other site
- Multisite Dashboard Always Redirects to Main Dashboard
- Redirecting specific sites to HTTP in WordPress Multisite
- Moving from a non WordPress site to a WordPress Site – Login between both sites
- WP Multisite child theme: get_template_directory_uri() seeks it’s own subdirectory instead of directory of parent theme
- WordPress Multisite VMware copy for dev use not allowing loggin
- Multisite,half the way
- Create new multisite from existing and keep domain?
- WordPress Multisite: Login to all subsites at once
- How to mapping a WordPress MultiSite Network Subdirectories to new domain with all subsites
- WordPress Multisite: an official and definitive way to enable https ? (http to https)
- Multi-site Installation in WordPress | Security & Future Migrations
- Get the latest 3 posts across the network
- Synchronize wordpress site between two different servers
- Blog broken after changing Site/Home URL
- What dictates whether a plugin will be available to a site in a multisite install?
- How do I setup WordPress Multisite in it’s own directory?
- Configuring Multisite with subdomains
- Autoblog posts in wpms(network) into main site including featured images
- Cron job disappering without notice?
- How do I remove ‘www.’ from all internal links in self-hosted multisite?
- How do I make a copy of WordPress to other folder
- MU Domain mapping
- WordPress multisite with subdirectories always redirects to mainsite
- Avoid landing page redirects issue in wordpress multisite
- Multisite website configure Domain issue
- Can i use the same content in two websites? one is the main website and one is directory website
- WordPress Multisite
- WPML is blocking WP core update
- Multisite: Redirect a deleted site – Best practice?