Wrong menu class for Portfolio post
Hi guys
I noticed that when you on single Portfolio project post, "Blog" menu item always has "current_page_parent" class, even if it does not contain this post as child menu element. Is there any way to fix it?
Mega menu extension is active on my installation

But where directs your Portfolio page?
Hey! In my case, "Portfolio" is a standard page, this is not Portfolio Archive link. The problem is that "Blog" should be not highlighted in any case, since this menu item has no any portfolio post child links
i investigated the problem, and it seems this is not Unyson problem, it's WordPress. I resolved this with following code:
add_filter( 'nav_menu_css_class', 'modify_nav_classes', 10, 2 );
function modify_nav_classes( $classes, $item ) {
if( ( is_post_type_archive( 'fw-portfolio' )
|| is_singular( 'fw-portfolio' ) )
&& $item->object_id == get_option('page_for_posts') ){
$classes = array_diff( $classes, array( 'current_page_parent' ) );
}
return $classes;
}