-
Author
-
July 14, 2016 at 04:22 #129163ashikaiParticipant
Hello again!
So I’m attempting to implement a network-wide menu; that is, I would like to create a global header for the whole network that is controlled by the root site.
I’ve done this with other elements by using the following:
switch_to_blog(1);
wp_nav_menu(‘main-navigation’);
restore_current_blog();
However, this doesn’t seem to work at all with the Kleo theme. I was wondering if perhaps the kleo menu walker isn’t compatible with this method.
If this isn’t an agreeable way to make the network-wide menu happen, then I was wondering if you could give me some insight to hard-coding a menu instead. For most links and drop-downs I’m ok, but when it comes to the special ones (login, register, notifications, avatar + dropdown), I’m not sure what their non-rendered code (which is what I need in order to preserve the functionality) looks like and I can’t seem to find it in the theme files or k-elements plugin files.
Is this something you could help me with?
Thank you very much!
July 14, 2016 at 19:17 #129218RaduModeratorHi,
Theoretically you should paste the switch_to_blog(1); before menu to be rendered in this file template : wp-content/themes/kleo/page-parts/general-header-section.php you can copy this file in child wp-content/themes/kleo-child/page-parts/
And the rest
wp_nav_menu(‘main-navigation’);
restore_current_blog();
Somewhere at the bottom of the file
Let me know
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 14, 2016 at 19:22 #129219RaduModeratorI’ve read again your messages about the special features from the header, like user notifications, woocommerce cart content and so on and unfortunately making this to work in the way you like it would involve lots of customizations in the core of the theme.
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 14, 2016 at 20:17 #129223ashikaiParticipantHmmmmmm nuts. For me the big thing is really the login/register, user avatar + notifications. WooCommerce doesn’t matter so much since I’m not using it. I mean, I *could* just set up identical menus on every single sub-site and have it work fine (I’ve done that before), but that’s a bit of a nightmare to manage if I want to change anything and I have more than five sites (which I do).
Currently I’ve just modified the wordpress toolbar to be my global navigation… and that might actually be better to use since it also appears in the backend, but it’s still a bit of a shame because I really like the Kleo header styling and function.
In any case, thank you! I’ll mark this as resolved. 🙂
July 15, 2016 at 17:08 #129273RaduModeratorOk
Good luck with these
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.