[Resolved] Disable header/menu shadow on start page?

Home Forums Support [Resolved] Disable header/menu shadow on start page?

Home Forums Support Disable header/menu shadow on start page?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1418902
    Rickard

    Hello!

    I am using a header/menu shadow (with the code below), and I want it to be active on all pages except from the start page. Is that possible?

    .main-navigation, .sticky-enabled .main-navigation.is_stuck {
    -webkit-box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    -moz-box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    }
    
    .main-navigation ul ul {
    -webkit-box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    -moz-box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    box-shadow: 0px 1px 5px 0px rgba(176,176,176,1);
    }

    Best regards,
    Rickard

    #1418935
    David
    Staff
    Customer Support

    Hi there,

    you can use WP body classes and exclude the home page like so:
    So your CSS would be this:

    body:not(.home) .main-navigation,
    body:not(.home).sticky-enabled .main-navigation.is_stuck {
        -webkit-box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
        -moz-box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
        box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
    }
    
    body:not(.home) .main-navigation ul ul {
        -webkit-box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
        -moz-box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
        box-shadow: 0px 1px 5px 0px rgba(176, 176, 176, 1);
    }
    #1420363
    Rickard

    Thanks David!

    I got it to work, eventually.

    It turned out that I had some other lines of code which also affected the header in some ways (which was causing the shadow I wanted to get rid off) – but I added “body:not(.home)” at the start of that code and then it turned out just the way I wanted.

    #1420385
    David
    Staff
    Customer Support

    Glad to hear that

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