Site logo

[Support request] Sticky Menu is not working.

Home Forums Support [Support request] Sticky Menu is not working.

Home Forums Support Sticky Menu is not working.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #2589066
    Jusung

    I am trying to use stiky menu but it is not working.

    My menu is a little bit complicated.

    I have primary menu and secondary meny on desktop.
    On mobile, I hide those 2 menu and show off canvas menu.

    I just set the sticky menu on, but it is not working.

    Can I just show the same menu as the sticky menu?

    #2589243
    Ying
    Staff
    Customer Support

    Hi Jusung,

    Your sticky menu is working, but as your navigation HTML structure is a bit different, it’s not working well.

    Try adding this CSS:

    nav#sticky-navigation {
        height: 50px;
        display: flex;
    }
    #2589677
    Jusung

    Can I have the same sticky menu with the original one?

    Like, I can’t see the secondary menu.

    #2589697
    Fernando
    Customer Support

    The Sticky menu is working for me on Desktop view. To clarify, are you wanting it to work on Mobile as well?

    Do you want the Secondary menu to be sticky as well?

    #2589791
    Jusung

    Yes. It should work on mobile as well.
    Also, there should be secondary menu on the sticky menu.

    Primary menu on right side and secondray menu on left side.

    #2589799
    Fernando
    Customer Support

    Do you already have it set to On on Appearance > Customize > Layout > Sticky Navigation?

    #2589802
    Jusung

    Yes. It is on and I just added this code.
    nav#sticky-navigation {
    height: 50px;
    display: flex;
    }

    #2589804
    Fernando
    Customer Support

    It’s not working from my end. Is it working from your end?

    #2589829
    Jusung

    Sorry. I don’t understand.

    I can only see primary menu on the center.
    I want to see primary and secondary menu there.

    #2589848
    Fernando
    Customer Support

    For reference, can you share a screenshot of what you’re seeing?

    Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots

    #2589851
    Jusung

    This is what I see and this is way different from my menu.

    #2589857
    Fernando
    Customer Support

    I see. If that’s what you’re looking for, you’ll need to hook the Secondary Nav generate_inside_navigation.

    Create a Hook Element with this code:

    <?php
    if (function_exists('has_nav_menu') && has_nav_menu('secondary')) {
    	generate_secondary_navigation_position();
    } 
    ?>

    Hook it to generate_inside_navigation.

    #2591727
    Jusung

    It works. It makes the secondary menu on sticky menu.

    However, it also make another secondary menu on original menu.
    So, there are 2 secondary menu on original menu..

    Is there a way to make this by adding CSS?

    #2592985
    David
    Staff
    Customer Support

    Hi there,

    why not use a single navigation on mobile ?
    We can style the first lot of menu items differently using CSS.

    #2593289
    Jusung

    I don’t understand.

    I am just trying to make stikcy menu.
    The mobile menu has to be off canvas so that I can include all the menu I want.

    The reason stikcy menu not working is beacause of off canvas menu..?

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.