I’m building my site with pages, not worried about posts here.
If I structure my pages as follows:
When I’m on the About Us page the page name in the navigation is highlighted. But when I go to History or Contact the parent page name in the nav is no longer highlighted. How do I change this? I’m new to coding, basically teaching myself as I go.
Here’s a snippet of my current nav code in my header.php file:
Is there a reason you’re manually listing the top-level pages?
Take a look at the Codex entry for wp_list_pages. It explains the use of that template tag in pretty good detail; wp_list_pages gives active pages a class of current_page_item, and active pages’ parents a class of current_page_parent. Styling is just a matter of changing “current” in your stylesheet to “current_page_item” or “current_page_parent”, if you let WP do the dirty work.