This topic has 4 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #129163
     ashikai
    Participant

    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!

    #129218
     Radu
    Moderator

    Hi,

    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 solution
    #129219
     Radu
    Moderator

    I’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 solution
    #129223
     ashikai
    Participant

    Hmmmmmm 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. 🙂

    #129273
     Radu
    Moderator

    Ok

    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
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?