• I was trying to insert Mailchimp custom code in the header php file of my theme via the theme editor on the admin dashboard and after l hit update the entire header php code disappeared and my site lost all the format, the header section and background color etc, now what appears is just text. I am using Listable theme by pixelgrade.

    What can l do to restore my site and get everything back?
    Really worried, help with some tips please.

    • This topic was modified 5 years, 2 months ago by fidnko.
Viewing 2 replies - 1 through 2 (of 2 total)
  • after l hit update the entire header php code disappeared

    Unless you’ve opened the header.php file again and seen it to be completely blank, I wouldn’t come to this conclusion. What’s more plausible is that your edit introduced some error, preventing it (or some part of it) from executing.

    What can l do to restore my site and get everything back?

    The easiest way out would be to grab a fresh copy of the header.php file from the theme and replace it with what’s online. You may need some form of file access to do that: FTP, web-based File Manager (from your host), or even a WordPress File Manager plugin.

    If you continue to have a problem with this, please contact the Listable theme’s author for help. This is a commercial theme, and as we don’t have access to commercial themes here at WordPress.org, we’re unable to help with issues specific to the theme.

    And to prevent such issues in the past, it’s generally not a good idea to edit theme & plugin files directly, especially for something as simple as inserting JavaScript code. If you have no option and MUST edit theme files, create a child theme instead. This way, you can safely update the theme without losing your changes. But to simply insert JavaScript code, perhaps a plugin would be a better idea.

    Good luck!

    Thread Starter fidnko

    (@fidnko)

    Thanks George!
    I did open the header php file again after l saw that the site was disfigured and that’s when l noticed the header php code was deleted.
    I will try doing what you have recommended, hopefully l will have it sorted.

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

The topic ‘header.php disappears’ is closed to new replies.