Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #985671

    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

    #985707

    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

    #985885

    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

    #986190

    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”
    2018-07-16_210507
    Unless there is anything else we can assist with on this issue, shall we close this then?

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.