xxxxxxxxxx
/* INSIDE YOUR functions.php or snippet or plugin -> Add to header some code */
add_action('wp_head', function (){
?>
<script>PASTE HEADER CODE HERE</script>
<?php
});
xxxxxxxxxx
/* INSIDE YOUR functions.php or snippet or plugin -> Add to header some code */
/* Describe what the code snippet does so you can remember later */
add_action('wp_head', function (){
?>
<script>PASTE HEADER CODE HERE</script>
<?php
});
Add script to header of WordPress Site
xxxxxxxxxx
function ti_custom_javascript() {
?>
<script>
// your javascript code goes here
</script>
<?php
}
add_action('wp_head', 'ti_custom_javascript');