| Web Design & Programming Building websites, coding scripts or developing apps? html, css, javascripts, ajax, php, asp, java, c+, C++ and other geeky info is here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Status: Junior Member Join Date: Aug 2009 Posts: 1
![]() | i am making my first PHP based template and am having trouble finding a way of adding the "active" class to a menu. It would probably have to be based on the URL as the code is saved as an extra file and then included using <?php include"menu.php";?> Any ideas very much appreciated thank lirpa now what would you suggest i put between the <?php if .... ?> ok. i ended up using <?php $page = thenameofthepage?> on each page and <? if ($page = index) echo 'class="acitve"?> for the home page and <? if ($page = downloads) echo 'class=?> for the downloads, ect... |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |