[Resolved] Trying to disable Secondary Nav on all pages except a few

Home Forums Support [Resolved] Trying to disable Secondary Nav on all pages except a few

Home Forums Support Trying to disable Secondary Nav on all pages except a few

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #587833
    Shaun

    I’m trying to disable Secondary Navigation on all pages except Product Archives and Product Taxonomy pages. At first I used this code:

    body:not(.post-type-archive) .secondary-navigation {
        display:none;
    }

    It successfully disabled the secondary menu on every page except this.

    However, I also want to include an exception for product pages like this one. The new code I’m using is this:

    body:not(.post-type-archive) .secondary-navigation,
    body:not(.product-template-default) .secondary-navigation {
        display:none;
    }

    However, it doesn’t seem to work. In fact, it completely disables secondary nav menu everywhere. Am I choosing the wrong CSS class, or is my code wrong?

    GeneratePress 2.1.2
    GP Premium 1.6.2
    #587947
    David
    Staff
    Customer Support

    Hi Shaun, you can try multiple not selectors e.g
    body:not(.post-type-archive):not(.product-template-default) .secondary-navigation

    #587963
    Shaun

    Ah! So that’s how you use multiple not selectors. Thanks so much for your help! 🙂

    #587978
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.