[Resolved] Different menu layout for homepage

Home Forums Support [Resolved] Different menu layout for homepage

Home Forums Support Different menu layout for homepage

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1119636
    Matteo

    I have setup a layout for the primary menu, but it affects the whole site. I’d like to keep the same menu but change the layout only for the homepage. In the homepage I prefer the classic menu style with the logo/name on the left and the menu on the right (desktop view, obviously), as it’s set by default.

    Can you help me?

    #1120165
    Leo
    Staff
    Customer Support

    Hi there,

    Try this PHP snippet:

    add_filter( 'option_generate_menu_plus_settings', function( $settings ) {
        if ( is_front_page() ) {
            $settings['navigation_as_header'] = 'true';
        }
    
        return $settings;
    } );

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

    Let me know if this helps ๐Ÿ™‚

    #1120210
    Matteo

    Good, but the name should be aligned to the left and the menu to the right.

    #1120220
    Leo
    Staff
    Customer Support
    #1120640
    Matteo

    Yes, now the name and the menu appear like in the screencast you made: centered.

    I’d like the name “Matteo Spigolon” aligned to the left and the menu aligned to the right.

    #1121316
    Leo
    Staff
    Customer Support

    Try this CSS:

    .home.nav-aligned-center .navigation-branding {
        margin-right: auto;
    }
    #1121928
    Matteo

    It doesn’t work.

    #1122122
    Leo
    Staff
    Customer Support

    I’m not seeing the CSS added.

    When I add it using browser inspect, it’s working:
    https://www.screencast.com/t/ieIgBRPEyiZ

    #1122793
    Matteo

    Now it’s work. Thanks.

    #1122843
    Leo
    Staff
    Customer Support

    No problem ๐Ÿ™‚

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