How can I retreive the category or page slug?
-
I am setting up a site where I have some static header navigation links – each is a link to either a page or a category.
I want the header navigation link for the current page to look different than the others. I normally do this for non-wordpress sites by assigning an ID to the body of each page and an ID to each nav item, then using CSS to change the design. For example on a page with body id=”about” the nav link with id=”about-nav” would look different by using code like:
#about #about-nav { color:#f00; }
I need to find a way to get the page slug and/or category slug as PHP variables so I can make them the body ID (or class). Any tips?
Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How can I retreive the category or page slug?’ is closed to new replies.