Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Absolutely.

    If you’re using Code Snippets Pro, you can select the appropriate option when creating a Content snippet, and your code will be compiled together into a single .js file that is linked in a <script> tag:

    Alternatively, if you’re prefer to embed the script inline, as is often the case for tracking codes, you can select one of the two relevant options when creating a Content snippet:

    Alternatively, if you’d prefer to embed the inline scripts or you’re not using Code Snippets Pro, you can achieve a similar result by adding this as a Functions snippet:

    add_action( 'wp_head', function () { ?>
    <script>
    
        // JavaScript code goes here
    
    </script>
    } );

    Or for the footer section:

    add_action( 'wp_footer', function () { ?>
    <script>
    
        // JavaScript code goes here
    
    </script>
    } );
Viewing 1 replies (of 1 total)

The topic ‘Header Footer Scripts’ is closed to new replies.