Tagged: child theme, header.php
Hello,
I need to add this script to the header:
<script>
window.CMS = true;
</script>
This script will be used to allow Chambermaster widgets.
I would like to add it to my child theme so it will not get overwritten after theme updates.
I saw a couple different solutions from the forum but started getting confused. Can you please suggest the best way to do this.
Thanks,
Monique
Hey Monique,
Try adding this code to the end of your child theme functions.php file in Appearance > Editor:
function add_custom_code(){
?>
<script>
window.CMS = true;
</script>
<?php
}
add_action('wp_head', 'add_custom_code');
Best regards,
Mike
That worked. Thank you!
Hi,
Glad that Mike helped you. Thanks for using Enfold :)
Best regards,
Nikko