[Support request] Adding Hook in the very top of

Home Forums Support [Support request] Adding Hook in the very top of

Home Forums Support Adding Hook in the very top of

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #321246
    Will

    Hi there,

    I need some code injecting at the top of all the other CSS / Javascript / Title / Meta tags in the header in order to run Google Optimize efficiently.

    Please can you help with this? I used the standard GP Hook but it loads last in the head tag

    #321254
    Tom
    Lead Developer
    Lead Developer

    Hi Will,

    You would do this:

    add_action( 'wp_head','tu_wp_head_first', 0 );
    function tu_wp_head_first() {
        ?>
        Your stuff in here
        <?php
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #321259
    Will

    Hi Tom,

    As a function.php or in the GP Hook?

    #321279
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.