Tagged: child themes, updates
-
AuthorPosts
-
March 23, 2022 at 12:34 pm #1345657
When I update to Enfold 4.9 last February I got a problem with unwanted changes in my footer.
It turned out that this issue was caused because I overide the footer.php file in my Child Theme. After replacing the footer,php file in my Child Theme with the parent theme version footer.php file did solve the issue (but I lost my edits)
I have 5 Enfold websites and all of them have a Child Theme with a footer.php and also a header.php file. For example, I use the header.php file for adding Google Analytics code in there, because by default Enfold is placing GA code in the footer which I don’t want.
But the issues with my footer after update 4.9 got me thinking: I don’t want to take the risk that after an Enfold update my footer.php and/or header.php file is causing issues because I overide them in my Child Theme.
So I quess that to be save from this kind of issues it’s better practice to only keep a style.css file in the Child Themes, and no further files?
Thanks,
Alwin- This topic was modified 2 years, 9 months ago by Alwin.
March 23, 2022 at 1:04 pm #1345660If your aim it to insert content into the head then just use the code snippets plugin or add a snippet to your child theme’s function.php file.
Something like the below snippet would work for either method and allow you to insert your GA code in the head;add_action( ‘wp_head’, ‘add_to_content_head’ );
function add_to_content_head() {
echo ‘
ADD YOUR GA OR OTHER CODE HERE
‘;
}Creating additional header & footer files in your child theme is always going to give you potential issues when updating the parent theme.
March 23, 2022 at 1:15 pm #1345662Hi, I have a similar issues…
All the widgets on the footer are not displayed anymore since 4.9…
They are replaced by the default ones when you install the Enfold theme..
Someone can help me to fix this ? or maybe its a bug from the theme ?Thanks ,
March 23, 2022 at 1:18 pm #1345663Benojack
When I’ve seen this issue previously the widgets in the footer columns had all switched back to default.
Are you able to edit your footer and select the correct widget areas from the dropdowns again?March 23, 2022 at 3:05 pm #1345688Hello Steve, thanks for your quick reply.
On the backend in wordpress, the widget are still there like before, but when I go in the website, my widgets are not displayed… its the “default one”…
Very strangeMarch 23, 2022 at 3:08 pm #1345690Do you mean they still show in Appearance > Widgets or do they show in the footer page (if you have it set to use page as footer).
I had to go into my footer pages and reselect the correct widget areas for each column.
If they’re shown correctly in admin it may be worth changing them & saving before changing them back & saving again?March 23, 2022 at 3:15 pm #1345693Yes , I did that ! And for check I add some more news widget, and they didnt displayed too..
March 23, 2022 at 4:51 pm #1345720Hi Alwin,
There’s no point in overriding a whole file if you are only looking to add a tracking code or similar, you can use a function in functions.php like suggested above by @steve. Also, if you want to make sure that nothing breaks on your sites after an update, then perform the update on a staging or development site first.
Best regards,
RikardMarch 23, 2022 at 4:53 pm #1345722Hi benojack,
Are you overriding header.php or footer.php in a child theme? If so, then replace those files with the parent theme files, then add your customisations back in after that. If you need further help, then please open a new thread and include WordPress admin login details in private, so that we can have a closer look at your site.
Thanks for helping out @steve :-)
Best regards,
RikardMay 6, 2022 at 4:33 pm #1350818This reply has been marked as private.May 7, 2022 at 9:56 am #1350846Hi williamslyd,
Are you overriding footer.php or header.php in your child theme? If so, then please try to replace those files with the parent theme version, then add your customisations back in after that. If you need further help, then please open a new thread and include WordPress admin login details in private, so that we can have a closer look at your site.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.