Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Resolved] Add to header

Home Forums Support [Resolved] Add to header

Home Forums Support Add to header

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
  • #1178010

    Im implementing a GDPR Cookie Concent plugin:
    Maybe good to know: Running Wordfence

    They are telling me to add a script after the header section.
    Im adding this to my header.php file following this guide:
    But when i trying to enter my site it kind of “freezes” and the popup doesnt show.

    Should this be any issues? Im a editing the wrong file?

    Many thanks,


    Hi Patrik,

    Don’t change internal Theme files they will be lost once you update the Theme when a new version is released.

    You should use Hooks if you need to inject any third-party code on your project.


    Many thanks,
    Is it somehow possible to force it to appear directly after <head>?
    <!DOCTYPE html>
    <html lang=”en-US”>
    <script type=”text/javascript” src=”……js”></script&gt;
    <meta charset=”UTF-8″>
    <link rel=”profile” href=”″&gt;
    <title>Informator – Informator</title>

    Customer Support

    Hi there,

    So you want that code to be at line 19 here?

    There is no hook there unfortunately.

    You can copy the file below and paste it into your child theme folder and add the code where desired:

    Let me know if this helps 🙂


    Hi Leo,
    Thank you!
    Actually it must be here, its a cookie concent plugin and this scripts needs to be here so im 100% it auto disables all cookies and stuff automatically

    So i really dumb question now, will this replace the active “website” somehow?
    Should i search for a file called header.php?

    Customer Support

    That case the wp_head hook is what you need:

    What was the issue with that?


    Ill put it with the wp_head and you will see where it shows 🙂
    give me 2 min

    Customer Support

    Try using priority 1 and see if that’s better.


    So i did this:
    – Not quite sure why its red?

    Original script is wrote:
    <script type=”text/javascript” src=”……js”></script>

    And it ends up here, its at the end:

    Customer Support

    Is it the same if you use priority 1 in the hooks element?

    If so you will need to copy the file below and paste it into your child theme folder and add the code where desired:


    Yeah, sad it doesnt work because I dont know nothing about code haha!
    Allright, so are you able to quickly tell me where your theme has child theme folder?

    And in that folder i place this php file?
    Will this overwrite existing code and stuff?
    Cause somehow i got bunch of code there

    Customer Support

    You will need to install a child theme:

    By default there will be a style.css and function.php in that folder.

    Then you will want to copy and paste this file:

    And also name it header.php in the same folder.

    Then make the edit there.


    Thanks Leo,
    Is the link for your documentation correct?
    Because it seems like it not working

    Also seems like all profile pictures are gone here in forum

    Customer Support

    That link is definitely correct:

    Sounds like you are having some browser issue.


    Sorry, my ISP had as you sad technical problems.
    So if i copy and paste that header.php will it overwrite all the other code?

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