Answer the question
In order to leave comments, you need to log in
How to assign the active class to the menu item of the current custom post in WordPress?
Custom post type page. It is necessary in this menu to add the active class to the corresponding item in the menu. That is, you need to understand what post we are on and assign the active class to the corresponding menu in .
The structure of this menu is as follows:
<ul>
<li class="сюда нужен класс"><a href="#"></a></li>
<li ><a href="#"></a></li>
</ul>
<ul>
<li class="сюда нужен класс">
<span>Заголовок 1</span>
<ul>
<li><a href="#"></a></li>
</ul>
</li>
<li>
<span>Заголовок 2</span>
<ul>
<li><a href="#"></a></li>
</ul>
</li>
</ul>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question