Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Works like a charm!
    I have had the same issue and nothing there to be found =(
    This solved my request as well!

    Well done and thanks!

    Thread Starter Erik

    (@polder)

    Yes I know.
    But in my case that isn’t an issue because all sites use the same theme and format.
    So I just let the user switch to the blog which belongs to the menu.

    But as you pointed out above for other situations this solution won’t do the job….

    Thread Starter Erik

    (@polder)

    thanks for your reply!

    I have solved the issue this way:

    //Get the current blogID
    global $blog_id;
    //Specify an array holding which blogs the menu has to show up
    $blogs = array('9','10','11','12','13','14','15','16','17','18');
    if(in_array($blog_id, $blogs)){
    	//Remember the current blog_id
    	$current_blog_id = $blog_id;
    
    	//switch to the main blog which you want to get the menu from
    	switch_to_blog(5);
    
    	//output the WordPress navigation menu
    	wp_nav_menu( array( 'theme_location' => 'primary' ) ); 
    
    	//switch back to the current blog being viewed
    	switch_to_blog($current_blog_id);
    
    }else{
    	//If you're not visiting one of those blog which have shared menu show the blog menu instead.
    	wp_nav_menu( array( 'theme_location' => 'primary' ) );
    }

    Thread Starter Erik

    (@polder)

    Well here’s the deal. This earlier mentioned solutions doesn’t apply on my system because of following reason.

    1) An administrator must be able to edit the menu and it’s content pages hooked to it
    2) When browsing to a page in the “shared menu” will transfer the visitor to the blog for main content.

    I still haven’t found a good solution for this function. I would love to see a way where I just can say on the theme header.php to include the menu from blogID 1 (or what ID is relevant). Then all the menus will get updated when the administrator adds a page or move the menu objects around.

    About the content it would be lovely to see a way to stay on the blog and view the content of the shared info blog… Maybe making a page_shared.php theme page will do the job though… But how can I get content from another blog??

    Thread Starter Erik

    (@polder)

    Hi!

    Thanks for your reply.
    I was thinking about that solution already. And I think it will do to start with.

    Maybe I will dive into making an plugin and do some kind of approach from there. But now I made a site called about-our-schools and will put in static pages.
    On every school I will then create a meny and direct link to those pages.

    Or is there maybe a way to make 1 meny and use this as sidebar och mainmenu on those subsites?

    Thanks again for your reply.

    //Erik

Viewing 5 replies - 1 through 5 (of 5 total)