[Resolved] move primary menu under hero image on front page only

Home Forums Support [Resolved] move primary menu under hero image on front page only

Home Forums Support move primary menu under hero image on front page only

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1009444
    Melissa

    Is is possible to have my main navigation sit under my hero image, but only on the front page?

    #1009466
    Leo
    Staff
    Customer Support

    Hi there,

    Try this PHP snippet:

    add_action( 'wp', function() {
        if ( is_front_page() ) {
            remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 );
            add_action( 'generate_after_header', 'generate_add_navigation_after_header', 15 );
        }
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know if this helps πŸ™‚

    #1009519
    Melissa

    Great–Thanks! Can I style this one separately from the menu on other pages?

    #1009526
    Leo
    Staff
    Customer Support

    Not sure if I understand.

    Style what?

    #1009527
    Melissa

    The nav menu under the hero image

    #1009530
    Leo
    Staff
    Customer Support

    CSS is required. Let me know what you want to change πŸ™‚

    #1009532
    Melissa

    If you can just tell me how to target the css, I can manage from there.

    #1009567
    Melissa

    I’d like to center the menu, and turn the background of the menu bar grey.

    #1009579
    Leo
    Staff
    Customer Support

    Try this:

    .home .navigation-branding {
        display: none;
    }
    .home .main-navigation:not(.slideout-navigation) .main-nav {
        margin-left: auto;
        margin-right: auto;
    }
    .home .main-navigation {
        background-color: #333
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Let me know πŸ™‚

    #1009609
    Melissa

    That worked, but what I am aiming for is to align the whole menu in the center (on this page)

    #1009641
    Leo
    Staff
    Customer Support
    #1009907
    Melissa

    Worked beautifully. Thanks

    #1009914
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

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