• MisterZookeep

    (@misterzookeep)


    I searched the forums and tried several solutions for this problem, none of which worked. Every other file or template in the theme loaded in the theme editor pane. I could edit the file via FTP, but when I opened it in the WordPress theme editor, that file was blank. If I saved the blank file, header.php on the server was blank – which of course means the site loads without header content.

    Proposed solutions included update parts of tinyMCE, reload theme-editor.php from a clean download, check CHMOD to verify the file is set at 644. None of those worked in my case.

    I also pasted the text from header.php into a clean file in a different text editor, and uploaded that. Same result – blank header.php in WordPress theme editor. I opened header.php in a text editor via FTP client and it was all there.

    The same header.php file worked on other sites – just not on this latest install. Finally, I tried the simplest, obvious solution. I pasted contents of the header.php I’d uploaded by FTP into the WordPress theme editor loaded with the mysteriously blank header.php file and saved it. Voila! It loads as required.

    I didn’t pursue any more forensic analysis to see why WordPress would not load that particular file. I did think it might be helpful to anyone with a similar problem to make a note here of the solution that worked in my case.

  • The topic ‘Cannot edit header.php file in theme editor’ is closed to new replies.