[Support request] How can I use Navigation as Header EXCEPT on the home page?

Home Forums Support [Support request] How can I use Navigation as Header EXCEPT on the home page?

Home Forums Support How can I use Navigation as Header EXCEPT on the home page?

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #1942850
    Salim

    Hi there,

    I’m currently having an issue that I believe stems from using the navigation as a header.

    I’m unable to disable the header in any element unless I untick “use navigation as header” in the customisation settings.

    Is there a way to have navigation be the header except on the front page? I’m looking to implement an animated logo on the front page only, and none of the CSS I’ve searched for in your forums work, unless I disable it as a header.

    Having navigation as a header is super useful and helped me achieve the design I wanted on mobile and it looks great across the site.

    I’m wondering if there’s a CSS snippet or something I could use here.

    Much appreciated

    #1943084
    David
    Staff
    Customer Support

    Hi there,

    Enable the Navigation as Header in the Customizer, and the you can use this PHP Snippet to disable it on the front page.

    add_filter( 'option_generate_menu_plus_settings', function( $settings ) {
        if ( is_front_page() ) {
            $settings['navigation_as_header'] = 'false';
        }
    
        return $settings;
    } );
    #1943108
    Salim

    Thanks for your response!

    I’ve added the snippet and also tried adding to the theme files, but unfortunately, it isn’t working. Any ideas?

    #1943128
    David
    Staff
    Customer Support

    Where did you add the code exactly ? And are you using a Child Theme ?

    #1943129
    Salim

    I tried adding it to the code snippets plugin and also the theme itself. Neither worked. Not using a child theme (I know it’s risky but I only need one or two lines added).

    #1943134
    David
    Staff
    Customer Support

    Hmmm… lets try the reverse logic. Disable the Navigation as Header option in the Customizer then try this PHP Snippet:

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

    Hmm, still not working. Any further ideas?

    #1943141
    Salim

    So I have mobile menu enabled always, I got a CSS snippet through another support request and by searching through the forums. Would that affect things?

    #1943146
    David
    Staff
    Customer Support

    Can you share a link to the site ?

    #1943160
    Salim

    Added to the private notes section.

    #1943193
    David
    Staff
    Customer Support

    Do you have the Navigation as Header still enabled in the Customizer ? If so can you disable it.

    #1943525
    Salim

    Disabled now.

    #1943725
    David
    Staff
    Customer Support

    What other changes did you make ? Is the code i provided still active ?
    As i on the front page i see neither the Site Header or the Navigation as Header.

    #1943754
    Salim

    I’ve been trying a ton of different things for hours now. I think I’ll try a new strategy. I’ve removed navigation as a header, which wouldn’t respond to your code. Is it possible to have the logo and site title hidden on the front page only?

    Still though, when I disable the header, the primary navigation is taken out with it. And I just can’t figure out why.

    #1943760
    Salim

    Ok so I was able to add primary navigation ABOVE the header, but now it won’t sit on the right side. How can I achieve that? It’s a bit of a hack but it’s almost what I want if I can get the menu to float to the right above the header.

    Also… I need to remove the site logo from the mobile menu on the front page only. Is that also possible? On another forum request I opened I was told this could be achieved through having the header be the navigation… Which caused the issues we’re discussing now

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