Two menu items pointing to the same page – make one of them inactive

I have two different menu items that point to the same Page. When I visit the page, both of the menu items are active. I want to make a filter or something, so the first item stays inactive all the time.

I know how to make custom classes for my menu items and I also know how to make them active, using:

if( in_array(‘my-menu-class’,$classes)) {
$classes[] = ‘act’;
}

But I have no clue what code would make it inactive. I tried to mess with unset, but no luck.

Read more here:: Two menu items pointing to the same page – make one of them inactive

Leave a Reply

Your email address will not be published. Required fields are marked *