Add script after body is open

Marko Krstić
13 Jul 2022

One of the most common scripts include locations for analytics are inside header and after body is opened. In Scripts Organizer we didn’t wanted to bloat UI with this one as you can add it with simple code snippet.

<?php

function body_open_script() {
    ?>
        <script>
            // Your code gode here
        </script>
    <?php
}
add_action( 'wp_body_open', 'body_open_script' );

?>

Scripts Organizer Settings

Trigger location: Everywhere
Script Location: PHP

Was this article helpful?

Tags

Categories

Never miss new post again

Subscribe and get list of new posts in your inbox

Click to Copy