I am using WordPress as the CMS for my website. For my navigation menu, I am using WordPress' inbuilt navigation menu function. You add categories, page, etc, to this and it generates a list with certain classes you can style - like current-menu-item
.
My problem lies here:
I have several categories in my menu, and some posts have to be assigned to multiple categories.
If a post was for example in a
Category A
only, then when you are on the page with that post,Category A
would be highlighted in the menu.If a post is in
Category A
andCategory B
, then when you are on the page with that post,Category A
andCategory B
would both be highlighted.
How can I highlight only one menu item, even though the post is in multiple categories?