This article covers situations where you have a top navigation but you want to keep the parent page selected/highlighted/active when the visitor goes to one of its subpages.
WordPress adds a class "current_page_ancestor" to a parent page which you can use to apply the same styling as for current page i.e. "current_page_item"
.current_page_item, .current_page_ancestor { background:yellow; }
Credits:
Keywords: How to highlight "parent" navigation link when on "child" page
Disclaimer: The content in this post is for educational purposes only. Always remember to take a backup before doing any of the suggested steps just to be on the safe side.
Referral Note: When you purchase through a referral link (if any) on this page, we may earn a commission.
If you're feeling thankful, you can buy me a coffee or a beer