Site logo

Archived topic

Trying to disable Secondary Nav on all pages except a few

3 replies · Started by Shaun on May 30, 2018

Viewing posts 1–4 of 4

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?

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

Ah! So that's how you use multiple not selectors. Thanks so much for your help! :)

Glad i could help

This archived topic is closed to new replies.