[Resolved] How to show site title only when nav bar turns sticky

Home Forums Support [Resolved] How to show site title only when nav bar turns sticky

Home Forums Support How to show site title only when nav bar turns sticky

  • This topic has 5 replies, 3 voices, and was last updated 4 years ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #921296
    madmanweb

    Hi.

    As you can see on my site, the “site title” is turned off because there is a giant logo on top. But this logo disappears after scrolling down.

    Is there any way to show the site title only when someone has scrolled down (i.e., when the nav bar becomes “sticky”) so that it’s not lost from view? I need it to happen only on the desktop view.

    #921360
    David
    Staff
    Customer Support

    Hi there,

    with your current set-up the function that Tom Provides here would be the way to go:

    https://generatepress.com/forums/topic/site-title-disappears-on-sticky-header-navigation/#post-883727

    #921872
    madmanweb

    Hmmm, so kinda mixed results. The snippet works only if I assign a logo to the sticky navigation bar, not without. I guess I could try a clumsy hack like setting the logo to be 1×1 pixel, but if there’s a more elegant solution to be found by modifying the PHP in the snippet, I’d love it. ๐Ÿ™‚

    #921877
    Leo
    Staff
    Customer Support

    What if you add this CSS?

    .main-navigation.navigation-stick .sticky-navigation-logo {
        display: none;
    }

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

    #921891
    madmanweb

    Hi. That didn’t work at first but I added !important to the style and it works now.

    #921916
    Leo
    Staff
    Customer Support

    Awesome ๐Ÿ™‚

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