Site logo

[Resolved] Custom sticky logo for different pages

Home Forums Support [Resolved] Custom sticky logo for different pages

Home Forums Support Custom sticky logo for different pages

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2300659
    Michael

    Hi there

    I already have different header logos for different pages in place. Did that using a special header element and assigned it to the specific pages only.

    In addition, I would like to use the specific logo also for the sticky header. Currently, the sticky header contains my default logo but this is not correct for some pages. The goal is to always have the same header logo when at top of the page and if scrolled (sticky).

    Tried this code:

    .page-id-917 .sticky-enabled .main-navigation.is_stuck > .inside-navigation grid-container > .navigation-branding img {
      background-image: url("https://...");
    }

    What is the best way to achieve this?
    A hook does not help here, correct? At least I could not find an option for sticky elements there.

    Thanks a lot
    Michael

    #2301092
    Ying
    Staff
    Customer Support

    Hi Michael,

    Can you try this CSS:

    .main-navigation.navigation-stick .page-hero-logo {
        display: block;
    }
    .main-navigation.navigation-stick .site-logo:not(.page-hero-logo) {
        display: none;
    }
    #2301567
    Michael

    Thank you Ying, works good.

    I have extended your code so on the home page the sticky logo appears as well:

    .home .main-navigation.navigation-stick .site-logo:not(.page-hero-logo) {
        display: block;
    }
    #2302261
    Ying
    Staff
    Customer Support

    Awesome!

    Glad to help 🙂

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