Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hello I have a problem with the wordpress menu

I have the main menu

parent item has the same link width first page in submenu

Parent --- Haloterapie: www.site.com/halorepaie

Submenu --- Actiunea Terapeutica: www.site.com/halorepaie

When activated one of them,show that they are active all page in submenu

To show active page I made so:

add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
 if( in_array('current-menu-item', $classes) ){
         $classes[] = 'active ';
 }
 return $classes;
}

enter image description here

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.