Search for: Log In Free Support [Resolved] Header.php overwritten Home › Forums › Support › Header.php overwritten This topic has 3 replies, 2 voices, and was last updated 1 year, 6 months ago by David. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts June 26, 2019 at 1:26 am #941436 Micha Hello, after the update of your theme my Header.php was overwritten. Which is very bad, because it contains the google tag manager. but because I found it right away, I was able to solve the problem. I hope it won’t happen with the next update. best regards Micha June 26, 2019 at 3:53 am #941544 DavidStaff Customer Support Hi there, you should never make changes to the parent theme function files as they will always be overwritten when the theme updates. If you need to make changes to a function or a template then you need to use a child theme. The easiest and safest way to add the GTM codes is to use the Hook Element: https://docs.generatepress.com/article/hooks-element-overview/ Create a new hook. Add your first GTM code to its content. Select the WP_head Hook from the list. And set your display rules to Entire Site. Repeat this for the second code ( the one that is required within the Body) but use the before_header hook, and set priority 0. Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ June 26, 2019 at 4:29 am #941571 Micha Hi David, thanks for the info. I’ll take a look and create a child theme. best regards Micha June 26, 2019 at 4:41 am #941577 DavidStaff Customer Support You’re welcome Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In