Archived topic
Disabled Wordpress Heartbeat
7 replies · Started by Luke on March 25, 2021
Today I disabled Wordpress Heartbeat functionality because my site was slow probably because of it. I simply pasted a line of code in a functions.php folder. When there's an update of the GeneratePress theme will I have to paste and save this line of code again because it will stop working?
Hi there,
You can pick how to disable that with the choices given here:
https://onlinemediamasters.com/disable-wordpress-heartbeat-api/
As for adding codes in functions.php:
We don't recommend putting your code on the default theme's functions.php. It will get wiped when you update.
If you wish to use a functions.php for your site, use a child theme's functions.php.
Or if perhaps consider using Code snippets plugin to run your codes.
I think the best option for me would be to use a child theme, but I never used a child theme. How to access a child theme?
Read our article about it. :)
https://docs.generatepress.com/article/using-child-theme/
It includes a download link for a starter child theme. :D
Does it mean that if I upload this child theme I may lose the changes that I made to the default theme (although I'm not sure if I made any)?
Hi there,
if you made any edits to the GP Themes templates, functions.php or stylesheets - those will be lost when the theme gets updated.
Making edits to those files would have either require you going to Dashboard > Appearance > Theme Editor or accessing those files directly from your server.
Lets assume you haven't changed the theme files.
Before activating a child theme, copy any CSS you have added to Customizer > Additional CSS. And save that in a text file.
After activating child theme:
1. add your additional CSS.
2. Check these as mentioned in the Doc Elvin provided:
It’s important to note that you may need to re-upload your logo (Customize > Site Identity) and re-add your Copyright (Customize > Layout > Footer) as these are stored in a theme-specific database option.
I've never used a child's theme before so I am not sure how it works. When I activate a child's theme I can then make different changes to the theme and these changes will be reflected in the parent's theme. Is that correct? Once I'm done with making changes in the child's theme I then deactivate it and activate a parent theme again. Is it how it works? Or maybe I'm using the child's theme all the time? I don't switch back to the parent theme?
When I activate a child’s theme I can then make different changes to the theme and these changes will be reflected in the parent’s theme. Is that correct?
A child theme comes with a function.php by default so you can add the code in there without modifying the parent theme's function.php.
It doesn't look like you need to modify any other files.
Once I’m done with making changes in the child’s theme I then deactivate it and activate a parent theme again. Is it how it works?
No - you will want to keep the child theme installed and activated while keeping the parent theme installed and deactivated.