hi there, just wondering how to make my nav menu (text only) highlight when i am on that specific page. i know that by using unique headers instead of a generic one will solve this issue, but that is just inefficient. can anyone help me? any help appreciated! thanks
So long as you know what page you are on when you generate the menu you can check to see if the page that the tab represents is the same as the current page and if so, you give that tab an additional class. $tabs = array('home'=>'Home', 'about'=>'About ABC Corp', 'contact' => 'contact us'); foreach($tabs as $id => $label) { $cur = ($thisPage == $id)?'cur':''; echo "<li id='{$id}' class='{$cur}'>{$label}</li>"; } PHP:
that, or at the top of every page you set a variable eg $thisPage and then when you call header.php $thisPage already exists and is ready to check.