The correct way to add a custom script after opening body tag?
-
Hi.
Which is the best way with your theme to add a custom script after opening body tag? Because plugins like insert headers and footers are just not working 🙁
Thanks
Hello,
Usually, we use this plugin and it works correctly. Otherwise, you will need to customize template files but we don’t have instruction for such customizations. You can try to edit header.php
and footer.php
file.
Kind Regards
If I copy the header.php from theme folder to child-theme folder and I edit that I won’t lost customizations I will do at theme updates, right?
Yes, the file will not be overridden after the update. But note that if we change our header.php file in the parent theme, you will need to manually check this and add these changes to your child theme. Otherwise, the theme may not function correctly.
Okay, thank you! I managed to put my script into the body.
The topic ‘The correct way to add a custom script after opening body tag?’ is closed to new replies.