Support » Plugins » Hacks » Class based on nav item title not working

  • Hi,

    I am coding a custom theme. I’d like to add a special class to the
    <li> tags based on each’s title but the $items variable/parameter for nav_menu_css_class returns empty (var_dump($items) returns NULL).

    Hence ‘title_’ is all that’s returned in the following function:

    function filter_nav_item_css_attributes($classes, $item)
            $classes = array_intersect($classes, array('current-menu-item'));
            return $classes;
        } else {
            return ' ';
  • The topic ‘Class based on nav item title not working’ is closed to new replies.