PHP for navigation

by 3 replies
4
I have the following code that I created a CSS class for the "active" page in the navigation. This way when you go to each page, it will show where you are.

What php code can i use so that if it is the active page, it will use the "current_page_item" class?

Here is my code:
PHP Code:
<li class="current_page_item"><a href="index.php"><span>Home</span></a></li
#website design #navigation #php
  • You use CSS for this.

    Depending on your nav div it will be.

    #navdivId.current_page_item { }
  • Thanks for your help! Not exactly sure where to start though. I used a php header file that has my navigation in it. what do i put in the main page file to tell the nav what to display?
  • I think i might have found it: w w w. alistapart.com/articles/keepingcurrent/

Next Topics on Trending Feed

  • 4

    I have the following code that I created a CSS class for the "active" page in the navigation. This way when you go to each page, it will show where you are. What php code can i use so that if it is the active page, it will use the "current_page_item" class?