I’m having a problem with WordPress “is_category()” and “in_category()” functions. I do understand why this is happening, but it turns out that it’s not what I am looking for.
I need to highlight one of the tabs that are located in the main navigation element. When a post is added only to one category the problem doesn’t occur (which is understandable). It turned out though that the client wants some posts to be published in multiple categories and that’s where the problem starts to shine.
The problem also persists when I do enter a particular post that is in multiple categories.
Is there another way to highlight only currently selected category (in this case – “fitness”)? Or maybe I am approaching the problem from a wrong direction?
Thanks for any help in advance.
- The topic ‘is_category() highlights too many elements’ is closed to new replies.