[Resolved] Move Secondary Nav

Home Forums Support [Resolved] Move Secondary Nav

Home Forums Support Move Secondary Nav

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #499820
    Gabriele

    Hi,
    I’m trying to move the secondary nav below the page headers that I created with Gp.
    After a look in the forum for answers I tried this but didn’t work:

    add_action( 'after_setup_theme','tu_move_secondary_nav' );
    function tu_move_secondary_nav() {
        remove_action( 'generate_after_header', 'generate_add_secondary_navigation_after_header', 7 );
        add_action( 'generate_before_main_content', 'generate_add_secondary_navigation_after_header', 15 );
    }

    Please can you help me?
    Is it possible also to move the search widget in the secondary nav? This will work?

    https://generatepress.com/forums/topic/move-search-function-to-secondary-menu-position/#post-333155

    #499905
    Leo
    Staff
    Customer Support

    Hi there,

    Can you make sure the secondary navigation is set to below header in the customizer?

    Then the code should work. If not please link us to the page.

    Yup that solution should work ๐Ÿ™‚

    #500246
    Gabriele

    Hi,
    I managed to do it: there was a problem with GeneratePress Extender plugin, so I put the code in the function.php file on my child theme.
    But for a better mobile experience I have to exchange primary and secondary navigation, so now secondary navigation is set to float right on the header and primary navigation is set below the header: so I must do the same moving nav thing on the primary nav insted of secondary nav.
    How to move the primary nav from below the header to after page headers (or before content if it is a better solution)?

    #500315
    Leo
    Staff
    Customer Support
    #500530
    Gabriele

    Perfect, thanks a lot Leo! Now the difficult part: how can I hide a primary nav menu item and show it only on sticky menu?
    I imagine I could give a custom css class to the menu item and conditionally hide it unless sticky but I am a bit loss… are you able to give me an example of syntax in order to have some inspiration?

    #500724
    Leo
    Staff
    Customer Support

    See a similar example here: https://generatepress.com/forums/topic/center-sticky-nav-logo/#post-443357

    Can you open a new topic if you can’t figure out?

    Thanks!

    #501239
    Gabriele

    Thanks again Leo, I succeeded ๐Ÿ™‚

    #501261
    Leo
    Staff
    Customer Support

    No problem!

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