Change Navbar links on particular pages/classes

A while back, @Rad had helped with the request on this post:

https://theme.co/apex/forum/t/change-nav-link-color-only-on-posts/43840/2

Summary of issue:

  • Created an absolute positioned transparent header that site on top of full width masthead images
  • Navbar links are white
  • On pages with a sidebar layout, the navbar links cannot be seen

Following his guidance, I was able to successfully change my navbar links on pages identified as posts. I didn’t realize it until now that I also need to make these changes to the search results page. I tried, but am unable to alter the existing snippets to include the “.search-results” class. Anything I do seems to add the style changes to every page.

Any suggestions, or is there better class to target and different way to achieve this?

Hi Tyler,

Thanks for reaching out.

You can change your existing CSS selector with this :slight_smile:

body:not(.single-post):not(.search-results) .x-navbar

You can have multiple :not() and it must be implemented that way since it targets the same body of neither class.

Hope this helps.

@Rad, that did it!

I had the search-results class wrong.

Thanks so much!

On behalf of my colleague, you’re welcome. Cheers! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.