[Plugin: Simple Portfolio] Fix for wp_nav_menu current css class
-
function nav_list_portfolio_bugfix($classes, $item) { if (get_post_type() == 'portfolio') { // Change value to match the slug for your portfolio wordpress page $page = get_page_by_path('portfolio'); if ($page) { if ($page->ID != $item->object_id) { foreach ($classes as $key => $value) { if ($value == 'current_page_parent') { unset($classes[$key]); break; } } } else { array_push($classes, 'current_page_parent'); } } } return $classes; } add_filter('nav_menu_css_class', 'nav_list_portfolio_bugfix', 10, 2);
https://www.ads-software.com/extend/plugins/simple-portfolio/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Simple Portfolio] Fix for wp_nav_menu current css class’ is closed to new replies.