I
I
Igor2017-03-06 12:08:03
User navigation
Igor, 2017-03-06 12:08:03

How to add the current-menu-parent class to the main menu item "Blog" in Wordpress when opening a post?

Currently, when viewing a single entry, the menu item loses all classes of the active item.
055269237b76498096bbd2abf01b7c6f.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasya Petrov, 2017-03-06
@markinpro

General principle:

if( is_single() ){
echo 'class="current-menu-parent"';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question