Site logo

[Support request] Adding HTML to header

Home Forums Support [Support request] Adding HTML to header

Home Forums Support Adding HTML to header

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #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.

    #1812112
    David
    Staff
    Customer Support

    Hi 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 the wp-head hook.

    #1812504
    Kiogora

    Thanks for the reply .

    When it comes to Display Rules
    What should I choose
    Entire site
    Front page or blog

    Thanks

    #1812527
    Leo
    Staff
    Customer Support

    That 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.

    #1812537
    Kiogora

    Hey Leo,

    Am new in this field

    This a google AdSense code where is the best place to display?

    Thanks

    #1812540
    Leo
    Staff
    Customer Support

    Go with Entire site.

    #1812578
    Kiogora

    Hi Leo,

    When I click publish am getting notification page can not be found.

    #1812593
    Leo
    Staff
    Customer Support

    Hmm. Does the same issue happen if you just add a simple text instead of the Adsense code?

    #1812601
    Kiogora

    Have not tried any other text

    #1812649
    Leo
    Staff
    Customer Support

    Can you give it a shot?

    Simply create a new hook and add a text. Does that triggers an error?

    #1813759
    Kiogora

    No its not sending any error

    #1813988
    Leo
    Staff
    Customer Support

    Are 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.

    #1814193
    Kiogora

    Thanks for the feedback.

    I will contact my host and get back to you.

    #1814490
    Kiogora

    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?

    #1814596
    David
    Staff
    Customer Support

    Is the code you’re adding to Display the Advert ? ie. you want the displayed advert in the site header ?

Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.