- This topic has 20 replies, 3 voices, and was last updated 4 years, 10 months ago by
David.
-
AuthorPosts
-
June 6, 2021 at 12:54 am #1811931
Kiogora
Hi Team,
Am getting this message when I want to add html code to the header. Its google AdSense code
Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.Thnaks.
June 6, 2021 at 5:22 am #1812112David
StaffCustomer SupportHi there,
never edit the Themes template files.
To add your code to your site you can use a Hook element:
https://docs.generatepress.com/article/hooks-element-overview/
To add code to the
<head>you would use thewp-headhook.June 6, 2021 at 10:11 am #1812504Kiogora
Thanks for the reply .
When it comes to Display Rules
What should I choose
Entire site
Front page or blogThanks
June 6, 2021 at 10:52 am #1812527Leo
StaffCustomer SupportThat depends on where you want the code to be executed.
If you want the code to work on entire site then you would choose the entire site.
June 6, 2021 at 11:00 am #1812537Kiogora
Hey Leo,
Am new in this field
This a google AdSense code where is the best place to display?
Thanks
June 6, 2021 at 11:03 am #1812540Leo
StaffCustomer SupportGo with Entire site.
June 6, 2021 at 11:38 am #1812578Kiogora
Hi Leo,
When I click publish am getting notification page can not be found.
June 6, 2021 at 12:05 pm #1812593Leo
StaffCustomer SupportHmm. Does the same issue happen if you just add a simple text instead of the Adsense code?
June 6, 2021 at 12:08 pm #1812601Kiogora
Have not tried any other text
June 6, 2021 at 1:50 pm #1812649Leo
StaffCustomer SupportCan you give it a shot?
Simply create a new hook and add a text. Does that triggers an error?
June 7, 2021 at 10:02 am #1813759Kiogora
No its not sending any error
June 7, 2021 at 2:04 pm #1813988Leo
StaffCustomer SupportAre you sure the code is copied and pasted correctly?
If so then something is blocking the code.
I’d recommend disabling all plugins except GP Premium to see if that resolves the issue.
If not, then please check with your hosting to see if there is some security built-in that stops the code from executing.
June 7, 2021 at 8:34 pm #1814193Kiogora
Thanks for the feedback.
I will contact my host and get back to you.
June 8, 2021 at 3:06 am #1814490Kiogora
Hi Team,
The AdSense code was added but its not showing in the header I added A New Element Title then Hook then location (entire site) and published.
But if I look in the my Home and check page source to look where the code is I see it in a very different location. Find the code in page source using this
adsbygoogle.js
Now my question is, is that place where the code is header.php?
June 8, 2021 at 4:31 am #1814596David
StaffCustomer SupportIs the code you’re adding to Display the Advert ? ie. you want the displayed advert in the site header ?
-
AuthorPosts
- You must be logged in to reply to this topic.