WordPress.org

Support

Support » How-To and Troubleshooting » is_category() highlights too many elements

is_category() highlights too many elements

  • 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.

    http://dev.andrzejkala.com/fabryka-diet/category/fitness/

    The problem also persists when I do enter a particular post that is in multiple categories.

    http://dev.andrzejkala.com/fabryka-diet/2010/04/08/test-x/

    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.

Viewing 1 replies (of 1 total)
  • As far as I’ve seen there isn’t any way to separate this. I had hoped to do the same with some of my sites, but couldn’t make it work.

Viewing 1 replies (of 1 total)
  • The topic ‘is_category() highlights too many elements’ is closed to new replies.