I am working on my first WordPress custom theme and I now have a problem. I've organized the site such that I'm using a front-page.php as my home page that shows a long page with some links. These links go to other Pages. Let's call these T1s.
On those pages, I have a long page body of content. I want to make some of those links go to Posts (Let's call these T2s) that have a category with the same slug as their parent Page.
The problem is that I don't know how to highlight the correct nav when viewing those Posts.
Somehow I need to look at the current post, grab its category and see if it matches the url slug of an item in the Nav and highlight that nav item.
Is this a custom filter?
I see that this happens automatically if I make the T2s be Pages, instead of Posts, and then set the parent/child relationship, accordingly. But then all site content will have to be Pages, with a fixed hierarchy. I wouldn't be using Posts at all.
I've also seen that if I make the Nav item be a Category that it'll happen automatically as well. However, I don't like the /category/ in the url.
I guess I need to figure out how to make a post's category match a page's slug in some filter?
Is that the best approach?