I have set up a child theme for my site. Is it possible to use the functions.php file in the child theme to insert a script into the head of each page so that when I update the parent, I do not lose the custom script within the header? I am aware that I can copy the entire header.php into the child theme, but I would prefer not to do that, so that the header can just update along with the rest of the parent theme as necessary. Thanks!
Hi tonyska!
Thank you for using our theme.
In functions.php of the child theme put the following:
add_action('wp_head', 'add_my_header_script');
function add_my_header_script()
{
echo 'your script code';
}
Best regards,
Günter
thank you! that did it!