[Resolved] hide secondary menu once logged in

Home Forums Support [Resolved] hide secondary menu once logged in

Home Forums Support hide secondary menu once logged in

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #251748
    Tom
    Lead Developer
    Lead Developer

    Getting there – lots of variables.

    I just adjusted the CSS above to include the mobile header which you have activated: https://generatepress.com/forums/topic/hide-secondary-menu-once-logged-in/#post-251665

    When logged in, the black logged in bar that wordpress shows scrolls out of site when going down screen. I could live with that I guess, but it’s different behavior than that desktop version.

    This is default WordPress behavior, the admin bar isn’t sticky on mobile.

    #252101
    Steig

    Thank you Tom. It works great. but I still have the problem for devices in the “mobile menu” mode. that clicking the secondary menu causes it to expand behind the header….unless you are at the top of the page. Then it expands over the header.

    #252188
    Tom
    Lead Developer
    Lead Developer

    Here we go, final code (hopefully!):

    /* Secondary Nav sticky */
    .secondary-navigation {
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 110;
    }
    
    /* Keeps below element from moving under header */
    body:not(.logged-in) .site-header,
    body:not(.logged-in) .mobile-header-navigation {
        margin-top: 30px; /* height of secondary navigation */
    }
    
    /* Primary Nav sits below secondary nav */
    body:not(.logged-in) .main-navigation.is_stuck,
    body:not(.logged-in) .main-navigation.navigation-clone,
    body:not(.logged-in) .mobile-header-navigation.is_stuck,
    body:not(.logged-in) .mobile-header-navigation.navigation-clone {
        top: 30px !important; /* height of your sticky secondary navigation */
        margin-top: 0;
    }
    
    .admin-bar:not(.logged-in) .main-navigation.is_stuck,
    .admin-bar:not(.logged-in) .main-navigation.navigation-clone {
        top: 62px !important; /* height of your sticky secondary navigation + 32px */
    }
    #252515
    Steig

    That did it! Thank you so much!!

    #252547
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! 🙂

Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.