• Resolved ginacc

    (@ginacc)


    Hello and thank you in advance for your help. Enlgish is not my first language so excuse me if I am not very clear. I′ll try my best.
    I need to insert a script into the head section of a website I′m building and I can′t seem to find where to put it since there is no header.php in the new FSE themes. I tried putting it in the header.html but it didn′t work so my question is, how can I acomplish this?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, you shouldn’t edit any source files for permanent solutions, they will be reset when an update is done.
    You may need to install a plugin that can put your code into the <head>

    Moderator bcworkz

    (@bcworkz)

    You can use the “wp_print_scripts” action to output <script> HTML. This fires before enqueued script references, so this is a poor choice if your script is dependent on scripts that are enqueued. For dependent script you could use the “wp_head” action. I’ve yet to use these techniques on a block theme. I assume they still work as expected.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to insert a script into the “head” of document with FSE’ is closed to new replies.