Home › Forums › Support › Header.php missing after 3.2.1 update. Lost popup and GA analytics script.
- This topic has 13 replies, 2 voices, and was last updated 5 months ago by
Leo.
-
AuthorPosts
-
October 31, 2022 at 10:26 am #2395782
John
Hello,
After the 3.2.1 update, I lost access to the child theme header.php via SFTP. I have lost google analytics and a popup for our newsletter which were located in the header.php file.
Can you please help – Thank you!
John Culotta
October 31, 2022 at 10:40 am #2395806Leo
StaffCustomer SupportHi John,
Hmm I’m not sure how that is possible – a child theme cannot be updated/changed during a parent theme update and we have not had any other reports on this.
A couple of options here:
1. Restore a backup before the theme update and make sure the code is placed correctly in the child theme.
2. Re-add the code and make sure it’s added using a child theme or a hook element.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 31, 2022 at 10:43 am #2395815John
Hi Leo – I agree, this is odd. I did try to restore with an older backup and still no header.php access in the child theme.
October 31, 2022 at 10:45 am #2395820John
Hi Leo – is there a way to add back my Google Analytics script and Newsletter popup form? Thanks!
October 31, 2022 at 10:52 am #2395836John
I didn’t want to add one more thing, but I also lost a blue button that was in the header on mobile. It’s on the desktop, but not mobile. WebDesignDev.com is the site we’ve been discussing.
October 31, 2022 at 11:27 am #2395859Leo
StaffCustomer SupportI did try to restore with an older backup and still no header.php access in the child theme.
Do you mean there isn’t a
header.php
file in the child theme? Then I’m guessing that it never existed – not sure how it could disappear otherwise.is there a way to add back my Google Analytics script and Newsletter popup form? Thanks!
I provided 2 options above:
https://generatepress.com/forums/topic/header-php-missing-after-3-2-1-update-lost-popup-and-ga-analytics-script/#post-2395806If #1 didn’t work then you will need to do #2.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 31, 2022 at 12:00 pm #2395879John
I’ll try it. Note that the header.php did exist because that’s where my Google analytics script, a popup, and popunder scripts were placed and worked fine before the update. Thanks.
October 31, 2022 at 12:02 pm #2395880Leo
StaffCustomer Supportbecause that’s where my Google analytics script, a popup, and popunder scripts were placed and worked fine before the update.
The only reason I can think of is that they were added in the
header.php
of the parent theme and not the child theme.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 1, 2022 at 10:46 am #2397121John
Hello Leo,
I hope you are not assuming that I’m making this up or exaggerating. Again, there is no header.php file with the child theme. I had these important scripts in there and they worked fine. Now they are gone.
Can you please give me some direction or refer me to a developer?
Thank you,
JohnNovember 1, 2022 at 10:46 am #2397124John
if there is a way to provide screenshots, please advise.
November 1, 2022 at 10:49 am #2397130John
Regarding your 2 suggestions:
1. Restore a backup before the theme update and make sure the code is placed correctly in the child theme.
ALREADY TRIED THIS PRIOR TO OUR CONVERSATION AND NO GO. STILL THE SAME.2. Re-add the code and make sure it’s added using a child theme or a hook element.
CAN NOT RE-ADD CODE, BECAUSE CHILD THEME STILL MISSING HEADER.PHP. I DON’T KNOW HOW TO “HOOK ELEMENT” AS YOU’VE SUGGESTED. I’M NOT A DEVELOPER AND NOT THAT SAVVY AT THIS.November 1, 2022 at 10:54 am #2397134Leo
StaffCustomer SupportALREADY TRIED THIS PRIOR TO OUR CONVERSATION AND NO GO. STILL THE SAME.
Does the GA analytics and the Newsletter popup form work when the backup was restored? If so that means the code is being added somewhere else.
CAN NOT RE-ADD CODE, BECAUSE CHILD THEME STILL MISSING HEADER.PHP.
Sounds like there is a bit of misunderstanding here.
By default, the child theme does not have the
header.php
file included. It is up to you to copy the file and paste it into the child theme folder when needed:
https://github.com/tomusborne/generatepress/blob/master/header.phpDoes that make more sense?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 1, 2022 at 11:03 am #2397151John
No, when i did a backup restore, the GA analytics script and newsletter form did not come back. My GA analytics have been showing “0” traffic since this happened and we normally have 40k a month.
I appreciate you making a suggestion with the link below, but I have no idea what to do with this info:
https://github.com/tomusborne/generatepress/blob/master/header.phpQuestion: Can i just add a plugin where I can add these important scripts (back in) to the child theme header?
Thanks,
November 1, 2022 at 11:35 am #2397186Leo
StaffCustomer SupportQuestion: Can i just add a plugin where I can add these important scripts (back in) to the child theme header?
No – the plugin method would be the same as using the hook element suggested.
If all of your scripts needs to be added in the
<head>
tag then you can just create a hook element for each script and use thewp_head
hook:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/wp-head/Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.