[Resolved] Site title disappears on sticky header-navigation

Home Forums Support [Resolved] Site title disappears on sticky header-navigation

Home Forums Support Site title disappears on sticky header-navigation

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #882532
    Miro

    Hello!
    In my header, I have a logo, site title, tagline and menu.
    When I scroll down and the sticky header appears, site title and tagline don’t show.

    I have found a couple of similar posts in this forum but haven’t been able to successfully implement the hooks which were advised to be used as a solution of the issue.

    The weirdest thing is that the title and tagline showed alright a few days ago.
    Logic dictates I must have messed something up but I am not at all aware of what it might be.

    Would be grateful for any assistance.
    Thank you.

    Miro

    #882682
    Tom
    Lead Developer
    Lead Developer

    Hi Miro,

    The site title and tagline don’t show in the sticky navigation by default.

    The site title can display in the sticky navigation if you set your navigation as your header: https://docs.generatepress.com/article/navigation-as-a-header/

    Otherwise, we can use hooks to add them into the sticky nav if you’d like.

    Let me know πŸ™‚

    #882914
    Miro

    Hello Tom,
    thanks for a quick reply. I tried setting the navigation as header but didn’t like the look of the outcome. Tagline disappeared and the whole header got more narrow even before scrolling.

    I would like to have the header as it is now. Then, when it sticks after scrolling, I would like to have the site title displayed (not the tagline). Could you, please, give me a hand with creating the hook you mentioned?

    #883371
    Tom
    Lead Developer
    Lead Developer

    Definitely! Any chance you can remove the coming soon page so I can make sure the HTML/CSS I give you will work first try?

    Let me know πŸ™‚

    #883374
    Miro

    Of course. Done.

    #883727
    Tom
    Lead Developer
    Lead Developer

    Let’s try this function:

    add_filter( 'generate_sticky_navigation_logo_output', function( $output ) {
        $title = '<div class="sticky-navigation-title">Your Title Here</div>';
    
        return $output . $title;
    } );

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

    Let me know πŸ™‚

    #883829
    Miro

    Thanks Tom, the function works like a charm!
    And by the way, thank you for the best wp theme ever. πŸ˜‰

    Have a great day.

    Miro

    #884500
    Tom
    Lead Developer
    Lead Developer

    Awesome! Thank you for using it!

    You too πŸ™‚

    #1671511
    David

    Hi Tom, I am trying this snippet on this site and having no luck. Any thoughts? subliminaryartworks.com

    I am using Code Snippets as per suggestion. Thanks much, Dave

    #1671521
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic for your question?

    This one is a bit old.

    Thanks!

    #1672319
    David

    Done.

    #1672935
    Leo
    Staff
    Customer Support

    Thanks πŸ™‚

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