Hey, I wonder if someone can help me. I'll try to make as much sense as possible, but if you need any more info, just let me know.
Here's the page I'm working on Tods Murray v Arakin
I have a fairly straightforward navigation bar along the top of my page:
<ul>
<li><a href="http://todsmurrayvarakin.com/" class="active">Home</a></li>
<li><a href="http://todsmurrayvarakin.com/the-case/">The Case</a></li>
<li><a href="http://todsmurrayvarakin.com/latest-news/"> >Latest News</a></li>
<li><a href="http://todsmurrayvarakin.com/contact/">Contact us</a></li>
</ul>
I'd like each a's class to be set to active on the appropriate page.
The homepage is a static page, so that was straightforward enough, I used <?php if (is_page(9)) { echo " class=\"active\""; } ?>.
The same goes for the contact page too.
The Case and Latest News are more difficult and I don't know the best way to go about these two. The Case could be fairly straight forward as it's just another page, but I'd also like that to be the active class for a number of other pages (and their children, as I'll have to add more pages to it over time).
Latest News is the page where the actual blog is, with my posts. I can't get it to appear on the list of posts, but I can get it to appear on a single post page with if (is_single(). I tried adding an or, but I'm not that strong on php, so while if (is_single() or is_page('latest-news') doesn't break the page, it doesn't do what I want it to either.
Sorry if that's a bit confusing, but really any help would be fantastic.
Thanks in advance.
James.