If it helps anyone, the way I have done highlighting for my tabbed navigation (similar to what is used on Binary Bonsai – not that you can see it yet, because the site isn’t live) is to break up the header.php into two files. The first contains everything down to the <body>
tag, and the second contains the header html, in my case including the navigation, that comes after the <body>
tag (I called this second file ‘header_block.php’). Then in each page that is used as a template or that makes a call to get_header(); I just replaced it with:
<?php get_header(); ?>
<body id="archives">
<?php get_headerblock(); ?>
Of course, the navigation could be put anywhere in the page – it doesn’t have to be part of the header – that’s just where my navigation happens to sit. You would obviously set the ID on the <body>
tag here to be the ID of the navigation item you want highlighted when that page, or pages using that template, are viewed. So each navigation item also needs to have an ID assigned to it, e.g:
<ul>
<li id="home">Home</li>
<li id="archives">Archives</li>
<li id="about">About</li>
</ul>
And in the CSS you can then set the specific styles for these IDs by using something like body #archives {};
.
I hope this maybe helps anyone trying to do this – I hunted for a while until I could piece a few articles together to work it out. Sorry I haven’t got a live version up yet – will post a link once it is!