Hello, use Insert Header and Footer plugin.
thanks and for the body ?
or how can i get it inside the editor ?
You need to only place code in the Head section of your site for Google Tag Manager.
If you also want to add code in the body section. Go to editor > and select header.php file. Add your code here within the body.
I dont have header.php in the editor i only have finctions.php ( i added the script there and it gave me an error. it doesnt make sense that i would add a script for the body but enter it into the header.php ?
Hello,
Please read the guide here – Google tag manager
If you will open header.php file then you will find body tag in it.
You need to copy header.php file in your child theme to make any change.
I dont have a header.php as mentioned in my opening question. I have added that plug in header and footer. But i need to add the script to the body.
How about this then….how can i add a header.php to the editor ?
You can add your code in the body section by the following method.
1) Header.php file located in the OceanWP parent theme. Copy this file and paste it in your child theme.
Now go to editor and add code after the body tag.
2) go to appearance > widget > sidebar widget.
Add your code in this sidebar widget using custom HTML widget.
I am using the child version. This is why it doesnt enable access to the header.php
do i need to modify in the Oceanwp theme or the child theme ?
Please follow the above mentioned steps.
ok,,,do i paste the header.php into the functions.php of the child theme ?
No, just copy the header.php file and paste it into your child theme folder along with the function.php file.
Now use an editor to open it and add your code.