Title: get_header() arguments?
Last modified: August 18, 2016

---

# get_header() arguments?

 *  [waraxe](https://wordpress.org/support/users/waraxe/)
 * (@waraxe)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-arguments/)
 * Is it possible to pass arguments to my header.php using the get_header() function?
 * Here’s why I ask. I’m having a devil of a time trying to make sure my highlighted
   navigation menu knows when I have a post showing from a certain category. (e.
   g. Perhaps I want my menu to highlight ‘FLASH’ if I have a post that is of the
   category ‘Flash’) To complete this seemingly monumental and insane task, that
   it looks like I’m the first person anywhere in the history of the world to want
   to do, I have a way to do it if I can pass a variable to my header.php from my
   single.php.
 * Ideas?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [niziol](https://wordpress.org/support/users/niziol/)
 * (@niziol)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-arguments/#post-341988)
 * I’ve posted a solution to what you’re seeking to do in [this thread](http://wordpress.org/support/topic/61831?replies=6),
   the code I put up on [pastebin](http://niziol.pastebin.com/563605) was done up
   for that particular thread, but you should be able to modify it to fit your needs.
   Let me know if you need any help.
 * Cheers,
    Michael.
 *  Thread Starter [waraxe](https://wordpress.org/support/users/waraxe/)
 * (@waraxe)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-arguments/#post-342001)
 * Michael,
 * The pastbin keeps timing out on me. Is there anywhere else?
 * Here’s a question. Even if I have some standard permalink turned on… (like mysite.
   com/archives/153)… is there a _URL variable or _SERVER variable (or even a tag
   for that matter) that will tell me what template file was used (e.g. category-
   24.php) ?
 *  [niziol](https://wordpress.org/support/users/niziol/)
 * (@niziol)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-arguments/#post-342014)
 * Pastebin seems to hate me for some reason – it’s working right now, but I’ve 
   posted the [code here](http://www.michael-niziol.ca/files/cpi-script.phps) on
   my website for you.
 * The script works by getting the requested URI, which for [http://www.example.com/home](http://www.example.com/home)
   would be /home and compares that to the `$homepage` which you set in the code.
   I just made it to highlight my non-WP homepage link, so it just does one comparision,
   but you can adapt it to do exactly what you’d like. The code is commented, so
   it’s self-explanatory.
 * Give it a go and feel free to ask for assistance if you get stuck!
 * Cheers,
    Michael.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get_header() arguments?’ is closed to new replies.

## Tags

 * [get_header](https://wordpress.org/support/topic-tag/get_header/)
 * [single](https://wordpress.org/support/topic-tag/single/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [niziol](https://wordpress.org/support/users/niziol/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-arguments/#post-342014)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
