V
V
Vladimir Sergeevich2015-07-23 21:07:37
User navigation
Vladimir Sergeevich, 2015-07-23 21:07:37

How to display child menu items when the parent class is active? And how do you add a class to the active menu item?

Hello folks, it's me again! I already asked 3 questions on the Toaster, including later I will return the debts) The
question is, There is a task to display child pages in the menu, with the parent active, you can of course implement it through CSS, but I want to study WP better ....
Plus the question of how add class to active menu item?
+100 karma for the answer! Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2015-07-23
@VladimirZhid

By default, WordPress itself adds all the necessary classes, for example:
.menu-item-has-children - the parent that has children
.current-menu-item - the current active menu item
.current-menu-parent - the parent of the current active menu item
.current-menu-ancestor and others.
Documentation and a complete list of classes - here .
How to add your class -here .
RTFM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question