Inserting Code into the head tag of your WordPress Theme


If you haven’t already done so, create a child theme to implement the following code into it’s “functions.php” file rather than directly onto your existing template file.

This helps prevent the code from being overwritten (lost) upon any future theme updates.


Insert Code into Header

** Code Insert into <head>
add_action( 'wp_head', 'child_theme_head_script' );
function child_theme_head_script()
    //my php code


If this article was helpful please take a moment to like us on Facebook, share this on your social media or buy us a cup of coffee.