Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #794904

    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

    • This topic was modified 7 years, 7 months ago by Krzysztof.
    #795049

    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

    #795075

    Hi Yigit
    Your polish is excelent!
    Your code works great for substrates. What I do to apply also for troubleshooting?
    BR
    Krzysztof

    #795079

    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

    #795083

    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

    #795088

    Hi Krzysztof,

    You are welcome, glad i could help :)

    Thanks! I hope one day :)

    Let us know if you have any other questions or issues and enjoy the rest of your day!

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Main menu the same indicator for child in breadcrumb hierarchy’ is closed to new replies.