Hi
I consider how I can set indicator (or just font colour) for main menu item when user is in portfolio item which are child in breadcrumb hierarchy.
Please find description here
Generally my goal is to show visual in menu that user is in current category. Maybe that is another way?
Thank you in advanced
Krzysztof
Dzien dobry Krzysztof!
Please add following code to Functions.php file in Appearance > Editor
add_filter( 'body_class', function( $classes ) {
if(is_singular('portfolio') && has_term('substrates', 'portfolio_entries')) {
$classes = array_merge( $classes, array( 'single-substrates' ) );
}
return $classes;
});
then please add following code to Quick CSS
.single-substrates li#menu-item-191 .avia-menu-fx {
opacity: 1;
visibility: visible;
}
.single-substrates li#menu-item-191 a {
color: #008B98 !important;
}
Best regards,
Yigit
Hi Yigit
Your polish is excelent!
Your code works great for substrates. What I do to apply also for troubleshooting?
BR
Krzysztof
Hi,
Dzieki! Courtesy of a weekend spent in Warsaw :)
Please add following code to Functions.php file as well
add_filter( 'body_class', function( $classes ) {
if(is_singular('portfolio') && has_term('troubleshooting', 'portfolio_entries')) {
$classes = array_merge( $classes, array( 'single-troubleshooting' ) );
}
return $classes;
});
then add following code to Quick CSS
.single-troubleshooting li#menu-item-188 .avia-menu-fx {
opacity: 1;
visibility: visible;
}
.single-troubleshooting li#menu-item-188 a {
color: #008B98 !important;
}
Best regards,
Yigit
Hi Yigit
Thank you again.
I invite you for a beer, when you visit Poland again. I live in Szczecin, it is north of Poland.
BR
Krzysztof