Use wp_nav_menu() to display a Menu from another site in a Network install?

This is what I’ve used recently. It’s very simple but it works well for me.

    function wp_multisite_nav_menu( $args = array(), $origin_id = 1 ) {

        global $blog_id;
        $origin_id = absint( $origin_id );

        if ( !is_multisite() || $origin_id == $blog_id ) {
            wp_nav_menu( $args );
            return;
        }

        switch_to_blog( $origin_id );
        wp_nav_menu( $args );   
        restore_current_blog();

    }

I’ve thrown this into a mu-plugin file that hosts a lot of small hooks and functions intended to run network wide.

Leave a Comment