Title: PHP/CSS help
Last modified: August 19, 2016

---

# PHP/CSS help

 *  Resolved [craigabailey](https://wordpress.org/support/users/craigabailey/)
 * (@craigabailey)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/phpcss-help/)
 * Hi,
 * I have a list item as a menu in my header.php file. I need a php function that
   allows me to set the class of the anchor tag to “active” based on which page/
   URL is currently loaded. I don’t mind if this is done by page ID, although would
   prefer to use URL so that I could have custom permalinks of domain/%postname%.
 * Any ideas welcome. So far I can get it to set all pages of a certain ID to active
   but that must mean I have got my statement being true no matter what page you
   are on.
 * Hope that makes sense?
 * Thanks in advance…

The topic ‘PHP/CSS help’ is closed to new replies.

## Tags

 * [class](https://wordpress.org/support/topic-tag/class/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [Page ID](https://wordpress.org/support/topic-tag/page-id/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [craigabailey](https://wordpress.org/support/users/craigabailey/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/phpcss-help/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
