Site logo

[Support request] Sticky secondary menu

Home Forums Support [Support request] Sticky secondary menu

Home Forums Support Sticky secondary menu

Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • #384176
    Alex

    I had to put that in there temporarily because the mobile menu was messing with the vertical center alignment property in the header. That wasn’t the issue if you disable that CSS then the issue persists.

    Sorry for the confusion.

    #384264
    Leo
    Staff
    Customer Support

    Little confused what the issue is currently? You are trying to hide one of the menus?

    #384272
    Alex

    I have 2 navigations:

    Primary: Used for Restaurant Menus page
    Secondary: Used for All Pages (this is my main navigation)

    I’m using the Primary nav on the Restaurant Menu page because it allows me to stick it for the abnormally long page.

    I only want the Primary nav to be on the Restaurant Menu page because it is only applicable to the Restaurant Menu page. It lists the various Menus (i.e. Lunch, Dinner, etc.) via anchors. If you were to see this navigation on the About page (1) it wouldn’t make sense and (2) the links won’t work because the anchors wouldn’t be on the About page

    So I disabled the Primary nav on all pages BUT the Restaurant Menu page. Works perfectly EXCEPT when in mobile view, the Primary nav still shows on all the other pages. Not only that, but it messes with the vertical alignment of my page headers.

    For the time being, I disabled the Primary nav completely with the CSS you mentioned above. But if you remove that style, you can see what is going on.

    *Edit: I think I fixed the “messing with vertical alignment” problem with the page headers. But the issue of the mobile nav appearing still exists.

    #384321
    Leo
    Staff
    Customer Support

    So you want to show only the Primary Nav (Menu) on the Menu page on mobile? But then people wouldn’t be able to navigate to other pages?

    #384326
    Alex

    Not quite. I want to show the Primary Nav always (Desktop and Mobile) on the Restaurant Menu page. I want to show the Primary Nav never (neither Desktop nor Mobile) on all other pages.

    #384351
    Leo
    Staff
    Customer Support

    Hmm can you try disabling the mobile header feature? https://docs.generatepress.com/article/mobile-header/

    #384371
    Alex

    Wow… it was that simple.

    That worked. Not really sure why but hey I can finally move on to the next problem. Thanks for your help Leo!

    #384372
    Leo
    Staff
    Customer Support

    No problem! Not an easy one to see 🙂

    #509743
    Dan

    Nice work on the site Alex

    #672840
    David

    Hey Tom,

    Did you ever include the feature to have two menus sticky?

    Thanks 🙂

    #673123
    David
    Staff
    Customer Support

    Hi there,

    there is not an built function for sticking both navs. We can help with some CSS, if you need to please raise a new topic 🙂

    #673138
    rex wickham

    Hi
    That is what this thread is supposed to be about. The original posted said “I just want to have 2 menus sticky.”

    #673193
    David
    Staff
    Customer Support

    There are a couple of options, we can for-go the GP Sticky navigation, and use the sticky CSS property on both navs.

    Or we could use a snippet like so, which removes a before header secondary navigation and hooks it inside the primary nav, which will make both sticky:

    add_action( 'after_setup_theme', 'lh_move_secondary_nav' );
    function lh_move_secondary_nav() {
        remove_action( 'generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
        add_action( 'generate_inside_navigation', 'generate_add_secondary_navigation_before_header', 7 );
    }

    In both instances this would require site specific CSS to format and style. But nothing too complicated.

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