Forum Moderators: coopster
I've been trying to figure out how to give a css class to an active link in a php navigation include. For example, if you're on the 'about' page:
<!-- nav.inc.php -->
<ul>
<li>Home</li>
<li class="active">About</li>
<li>Contact</li>
</ul>
However, if you visit the 'Contact' page, then that class changes to <li class="active">Contact</li>.
Is there a simple solution to this? The only idea that comes to mind is to add some sort of php 'if' statement using GET, such as:
<li <?php if($GET['about.php'] = TRUE) {echo 'class=\"active\"';}?> >About</li>
Any advice appreciated