0

Following situation:

I have a drop down menu. At the moment we are located on a single post of the category "Produkt Design"

enter image description here

Its class in the menu is menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-145 The parent to whom I want to apply a special styling, since it is the parent of the active menu entry, has the following classes

menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-151

How can I make to get a special class to show in parent?

See demo of the menu here

enter image description here

1
  • I did it using javascript now in the demo page. But a clean php solution would be better
    – Toskan
    Apr 29, 2014 at 11:05

1 Answer 1

0

You can add css classes to a menu item in the word press menu graphic interface. Either add the class to the parent or to the menu item then use css parent.

1
  • well that is the thing, you cannot style something like this .menu-parent (ifchildhasclass(current-post-ancestor)){color: red;}
    – Toskan
    Apr 29, 2014 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.