Archived topic
Copy & paste a code into my website before the closing tag.
1 reply · Started by Denis on October 9, 2020
I need to copy a code in the Theme header (header.php) before the closing </body> tag in order to set up Web Push Notifications for my AWeber account.
However, it seems that there isn't a closing </body> tag in the header.php file and therefore I cannot verify the code with Aweber.
I have checked with my hosting provider and they have referred me here, to the theme provider.
Can I just add this tag at the end of the file or is there something else I should do?
Thanks
Hi there,
closing body tags are outside of the header.php
There are there main WP hooks for adding codes:
1. wp_head - in the header: <head></head> tags
2. wp_body_open - immediately after the opening <body> tag
3. wp_footer - before the closing </body> tag
You can use the Hook element to add your codes to these hooks:
https://docs.generatepress.com/article/hooks-element-overview/