Calling wrong Header.php 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
- The topic ‘Calling wrong Header.php file?’ is closed to new replies.