Title: Calling wrong Header.php file?
Last modified: August 20, 2016

---

# Calling wrong Header.php file?

 *  Resolved [aliceralph](https://wordpress.org/support/users/aliceralph/)
 * (@aliceralph)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/calling-wrong-headerphp-file/)
 * Hello
 * This has completely baffled me for the last day.
 * I am building on a localhost and then using Subversion (Cornerstone & Deploy)
   to upload to my Dev site.
 * For my posts/single.php I am using the following code in the header to call different
   headers:
 *     ```
       <?php
       if ( has_post_thumbnail()) {
       get_header('Single');
       } else {
       get_header('Inner');
       }
       ?>
       ```
   
 * Basically I have two custom headers, ‘Inner’ and ‘Single’. ‘Single’ displays 
   the Featured Image within the header. If there isn’t a Featured Image then it
   defaults to the ‘Inner’ custom header which displays a default header for all
   internal pages (which is different to header.php, which I only use on the homepage…!)
   Everyone keeping up? 😉
 * So the bit of code above checks whether the post has a Featured Image or not.
   If it does then it uses ‘Single’, if not it uses ‘Inner’.
 * This works **absolutely fine** on my localhost build! Hurrah!
 * _HOWEVER_ (here’s the twist…)
 * …when I deploy it to my Dev site, it doesn’t use either ‘Single’ or ‘Inner’. 
   It defaults to header.php. I am only using header.php on the home page as it 
   has a slideshow plugin built into it. I have double checked via FTP and it using
   the exact same files as my localhost (incl the same version of single.php). I
   have tried clearing caches and using different browsers, even different computers.
 * This is so weird as the only thing that has changed is the hosting server and
   the .htaccess (as the Dev directory is password protected). I am using the exact
   same database and version of WordPress. Could this be PHP 4/5 related? Why would
   it cause that?
 * ANY help very very gratefully received as I am totally stumped!
 * Thank-you in advance
 * Alice

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

 *  Thread Starter [aliceralph](https://wordpress.org/support/users/aliceralph/)
 * (@aliceralph)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/calling-wrong-headerphp-file/#post-2489535)
 * PS. I am using Featured Content Slider plugin in my header.php file. Could that
   be a culprit?
 *  Thread Starter [aliceralph](https://wordpress.org/support/users/aliceralph/)
 * (@aliceralph)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/calling-wrong-headerphp-file/#post-2489627)
 * Okay after 2 days I have just fixed this!! *high fives myself*
 * If anybody else ever has the same problem… it was actually the bit of code above.
   I changed it from above to this:
 *     ```
       <?php
       if ( has_post_thumbnail()) {
       include("header-single.php");
       } else {
       include("header-inner.php");
       }
       ?>
       ```
   
 * Even though this renders exactly the same on my localhost, it now works on my
   Dev host. I presume this is a PHP thing that meant it wasn’t being read properly
   for some reason.
 * I still have no idea how or why this happened but that was the fix. SO SATISFYING!!!

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

The topic ‘Calling wrong Header.php file?’ is closed to new replies.

## Tags

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

 * 2 replies
 * 1 participant
 * Last reply from: [aliceralph](https://wordpress.org/support/users/aliceralph/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/calling-wrong-headerphp-file/#post-2489627)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
