Have you checked for any HTML mark-up errors?
http://validator.w3.org/
Hello WPyogi and thank you for helping,
When I check without copying the file to my child theme, the validator displays 9 errors, but as I say, the page shows ok.
When I take that same header.php from the parent theme and copy it to the child one, the pages doesn’t shows, and when trying to get it through the validator, it shows the error: “Sorry! This document cannot be checked. 500 Internal Server Error”.
I am astonished, just from copying the original file to the child theme, and only with the header.php one… Might this be an issue with my server? If so, any idea what could be provoking this?
Thank you very very much. Cheers!
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
What if, in your Child Theme header.php file, you replace all PHP (apart from top comments) with HTML.
E.g;
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package Packagename
* @subpackage subPackagename
*/
?>
djsaijdsijaojdoisajdsoia
Hi Andrew Nevins,
The header.php has lots of PHP scripts, but letting just you example it works…
This is really weird. Is there any reason why the same file works on a theme and not on a child one?
Thank you for helping. Cheers!
Hi again,
After copying line by line the original header.php to the child’s one I managed to see what piece of code prevent it from working ok.
As weird as it sounds, inside the header.php this theme has the following piece of php inside a <style> tag: http://pastebin.com/Q1rTnV1b
When I remove just those lines, the rest works without problem. As to why it works on the master template but not here, even just copying the entire file, I just don’t know…
Thank you for all the help!