Michael
|
Anyone know how to implement this? I have been having huge troubles getting it to work.
I have tried implementing: http://wpmututorials.com/plugins/networkwide-menu/
But without success.
tips and tricks welcome,
Michael
|
|
Michael
|
Oh, forgot.
It is 1 theme on the complete network, and I want the navigation unified. Dame menu on main site, as on subsites.
|
|
Michael
|
Here is a way that would work, jus tnot entirely sure where to put that in artisteer. Tried to put it into header.php in the NAV section but it did not work.
http://ostedesign.com/wordpress-multisite-global-navigation-menu-synchronization
tips still welcome,
Michael
|
|
Michael
|
Still no solution to this?
|
|
speedyp
|
Hey Michael
Not sure I understand the problem, or what you're trying to achieve?
You want all your subsites to share the same menu?
And they all have the same theme?
|
|
Abland
|
Hi, Michael,
In your theme's "header.php" find:
<?php
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'cu-hmenu'
)
);
?>
Add the codes in there:
<?php
global $blog_id;
$current_blog_id = $blog_id;
switch_to_blog(1);
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'cu-hmenu'
)
);
switch_to_blog($current_blog_id);
?>
|
|
Abland
|
Hi, Michael,
Note in my post above I'd used 'cu-hmenu' instead of 'art-menu' - be sure to use your prefix so styles stay intact.
|
|
Michael
|
Quote Abland:
Hi, Michael,
Note in my post above I'd used 'cu-hmenu' instead of 'art-menu' - be sure to use your prefix so styles stay intact.
|
|
Michael
|
Sorry for the double post!
Thanks for the help, works like a charm!
I copied the original theme to a new folder, edited the style.css and added above instructions into the header.php
mmo85 -> mmo85nm
edit style.css
edit header.php
This way I can have the old style and also a network version for select sites.
Thanks!
|
|
Michael
|
If I wanted to change the Vertical Menu I'd do the same changes in
sidebar-default.php
<?php ob_start();?><?php
echo theme_get_menu(array(
'source' => theme_get_option('theme_vmenu_source'),
'depth' => theme_get_option('theme_vmenu_depth'),
'class' => 'myr-vmenu'
)
);
?>
to
global $blog_id;
$current_blog_id = $blog_id;
switch_to_blog(1);
echo theme_get_menu(array(
'source' => theme_get_option('theme_vmenu_source'),
'depth' => theme_get_option('theme_vmenu_depth'),
'class' => 'myr-vmenu'
)
);
switch_to_blog($current_blog_id);
|
|
Abland
|
Hi, Michael,
I'm glad you posted this question. I looked at it when it first came up (a few months ago ) - and wanted to look into it but got side-tracked ... bills, groceries, etc
Thanks for finding and posting that code because I've got the answer now for my multi-sites, too.
|
|
Abland
|
Quote Michael:
|
|
Michael
|
Quote Abland:
I'm glad you posted this question. I looked at it when it first came up (a few months ago ) - and wanted to look into it but got side-tracked ... bills, groceries, etc
Thanks for the help and yea, I am getting sidetracked too easy aswell. Sometimes I feel I have an attention span of a fly :D
|
|
Michael
|
If you are still around, I could use a solution like this for the latest Artisteer v4.1.0.59861
The header.php looks a lot different now.
Testpage: http://dev-mmo.mmo-game.eu/
|
|
Michael
|
It is now online on http://www.mmo-game.eu
could still use a hint on where to insert the "switch_to_blog(1);" on the latest Artisteer.
|
|
Abland
|
Hi, Michael,
In header.php find:
<?php
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'myr-hmenu'
)
);
get_sidebar('nav');
?>
Edit to this:
<?php
global $blog_id;
$current_blog_id
switch_to_blog(1);
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'myr-hmenu'
)
);
switch_to_blog($current_blog_id);
get_sidebar('nav');
?>
|
|
Michael
|
Thanks, I'd have found it if it was that easy.
Here is my whole header.php
Appreciate the reply though,
Michael
|
|
Abland
|
Hi, Michael,
Is the menu in the header itself (not the file)? Check sidebar-header.php to see if the menu code is in there.
|
|
Michael
|
Thanks that worked like a charm in sidebar-header.php
However I added the code from the top posts, since the other code seemed to cause issues with top widgets. There was also a missing ";" after $current_blog_id from the second line. Here is the full example.
global $blog_id;
$current_blog_id = $blog_id;
switch_to_blog(1);
echo theme_get_menu(array(
'source' => theme_get_option('theme_menu_source'),
'depth' => theme_get_option('theme_menu_depth'),
'menu' => 'primary-menu',
'class' => 'myr-hmenu'
)
);
switch_to_blog($current_blog_id);
get_sidebar('nav');
Thanks a ton Abland!
|
|