Tagged: mailchimp pop up
Hi Support,
My site is linked to Mailchimp via an API code. In Mailchimp I have generated a code for a pop-up box for my site. Where should I place this code? In the header? I posted the code under Private Content along with access to the site.
Thanks,
ythhj
Hey ythhj,
You can place the code in Enfold Theme Options > Google Services > Google Analytics Tracking Code field because it only puts any content in the header, or you can add your code to this function and add this code to the end of your functions.php file in Appearance > Editor:
function add_custom_script(){
?>
<script>
//ADD YOUR CODE HERE
</script>
<?php
}
add_action('wp_head', 'add_custom_script');
Best regards,
Mike
Thanks, Mike!
Should any scripts I place in the functions php be enveloped in the code bit you sent me? And do I generally add scripts that are meant to be placed in the header, in the functions php of the child theme?
Best regards,
Yth
Hi,
Yes this code is for adding scripts via the functions.php & it’s a good way to add scripts.
The “wp_head” is what puts it in the head, if you want to add it to the footer, use “wp_footer”
Unless there is anything else we can assist with on this issue, shall we close this then?
Best regards,
Mike