Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1036494

    Hi,

    I am using Mailchimp and want to get the Mailchimp subscribe popup working on onclick
    (the standard popups can only be triggered immediately, after 5 seconds, after 20 seconds, after the visitors scrolls to the middle of the page, but not on a click.)

    To get this working a litte workaround is necessary, which is described here.

    The workaround works for me, the only problem is that it is necessary to add this script to the footer.php:

    <script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
    <script>
    function showMailingPopUp() {
      require(
        ["mojo/signup-forms/Loader"],
        function(L) {
          L.start({"baseUrl":"mc.us16.list-manage.com","uuid":"YOUR_UUID","lid":"YOUR_LID"})
        }
      );
     
      document.cookie = 'MCPopupClosed=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;';
      document.cookie = 'MCPopupSubscribed=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC;';
    }
         
    document.getElementById("open-popup").onclick = function() {showMailingPopUp()};
    </script>
    

    I would like to add this code to the footer.php of the child theme instead of the mother theme but I don’t know how to do that properly.

    Basically I know how to add a file to my child theme, but I am not sure how exactly the content of the footer.php should look like.
    Can I just copy the scipt in a empty footer.php file, or are there some other code lines necessary.

    I implemented the button here on this site.
    Login-data in the private content.

    Looking forward for your suggestions.

    #1036588

    Abort mission :)

    I give up on the popup (I encounterd another prob), so you can close the topic.

    #1036742

    Hi catchbudapest,

    I’ll be closing this then :)
    Feel free to create a new thread if you need assistance.
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Addind script to Footer.php in child theme (Onclick Mailchimp Subscribe Popup)’ is closed to new replies.