Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1167216
    rms_webpsykologen
    Participant

    Hi,
    I am not a programmer to start with.

    An external partner mailchimp wants me to add a javascript like this in order to have a popup on my site:

    <script type=”text/javascript” src=”//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js” data-dojo-config=”usePlainJson: true, isDebug: false”></script><script type=”text/javascript”>require([“mojo/signup-forms/Loader”], function(L) { L.start({“baseUrl”:”mc.us14.list-manage.com”,”uuid”:”cb0fd1e8a2747b2732a23d126″,”lid”:”c13b45761d”}) })</script>

    I tried to add it directly with the “add global javascript here” that says the following “donĀ“t put scripts tag here”

    with some trial and error I took away the tags? and ends up with this code

    src=”//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js” data-dojo-config=”usePlainJson: true, isDebug: false”
    require([“mojo/signup-forms/Loader”], function(L) { L.start({“baseUrl”:”mc.us14.list-manage.com”,”uuid”:”cb0fd1e8a2747b2732a23d126″,”lid”:”c13b45761d”}) })

    is this the correct way to do it.

    best regards/roger

    my site is http://www.lugn-och-ro.se and all the latest versions wp, X

    #1167607
    Darshana
    Moderator

    Hi there,

    You can remove that code and follow the instructions below.

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code into your child theme’s functions.php file.

    
    add_action( 'wp_footer', 'custom_mailchimp_script', 10 );
    
    function custom_mailchimp_script(){
          echo '<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us14.list-manage.com","uuid":"cb0fd1e8a2747b2732a23d126","lid":"c13b45761d"}) })</script>';
    }
    

    Hope that helps.

    #1167964
    rms_webpsykologen
    Participant
    This reply has been marked as private.
    #1168451
    Nabeel A
    Moderator

    Hi again,

    You’ll need to setup the Child Theme to make this work. The above script won’t work in Customizer global section because this needs <script> tag and <script> tag doesn’t work in Customizer global section.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1167216 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>