Title: get_header vs. include header.php
Last modified: August 18, 2016

---

# get_header vs. include header.php

 *  [waraxe](https://wordpress.org/support/users/waraxe/)
 * (@waraxe)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-vs-include-headerphp/)
 * I noticed that get_header() acts differently from include(‘header.php’). For 
   instance, when using a state variable to tell my navbar which menu item to mark
   highlighted I have to INCLUDE my header (it’s actually my footer that has the
   navbar but no matter)… because if I just use get-header() it doesn’t see the 
   variable.
 * There must be a difference in when the php is interpretted by the server.
 * Here’s a question: if I php include a file with php… can I then (in the included
   file) include another file with php… and so on… ? Will the server know to not
   stop interpretting all of these php tags until it’s done them all… and ONLY THEN
   send it to my browser?

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-vs-include-headerphp/#post-344159)
 * 1. `get_header` is a function written in the WP files.
    `include ('header.php')`
   is a normal PHP thingy. [now you can so how much a coder I am ;)]
 * 2. Have no idea.
 *  [niziol](https://wordpress.org/support/users/niziol/)
 * (@niziol)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-vs-include-headerphp/#post-344162)
 * I’m not sure if the only issue is having an indication in the menus, but in [this post](http://wordpress.org/support/topic/61831?replies=6#post-329649)
   I posted a bit of code I use to highlight the nav-bar for pages WordPress normally
   wouldn’t, not sure if that would be of help, but there it is anyway.
 * Good luck,
    Michael.
 * PS: I do believe you can have nested includes with PHP 🙂
 *  Thread Starter [waraxe](https://wordpress.org/support/users/waraxe/)
 * (@waraxe)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/get_header-vs-include-headerphp/#post-344176)
 * niziol :: Yeah, this is similar to the discussion we had before. I knew the code
   to highlight, but I had trouble finding, in every situation, some definitive 
   indicating factor I could use php to determine which menu item needed highlighting.
 * Yeah, I think you’re right about the nested php includes… because I’m already
   doing one nest (including header.php, which itself has plenty of php in it) and
   it’s working.

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

The topic ‘get_header vs. include header.php’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [serverside](https://wordpress.org/support/topic-tag/serverside/)

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

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
