Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #644322

    nataliapinzon
    Participant

    Hello,

    I need to add my mailchimp newsletter archives within a page.. Mailchimp provided me with a code but when I put that code within the custom CSS of the page I want the newsletter archives in, it puts the archives on the top of the page rather then in the body of the page.

    #644323

    nataliapinzon
    Participant
    This reply has been marked as private.
    #644333

    Rupok
    Member

    Hi there,

    Thanks for writing in! You can use our Email Form Extensions and configure MailChimp Integration – https://community.theme.co/kb/extension-email-forms/

    Regarding your question – You can use the CSS only (without script tag) within Customizer CSS and RAW JavaScript within the script box.

    If you need to add the external JavaScript file, 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.

    Add it into your Child Theme’s functions.php file.

    function custom_external_js() {
    	wp_enqueue_script('your-own-js', get_stylesheet_directory_uri() . 'http://us11.campaign-archive1.com/generate-js/?u=fb7ab3f06b4f70f53da5d2358&fid=2305&show=4', array('jquery'));
    }
    add_action('wp_enqueue_scripts', 'add_my_script');

    Hope this helps.

    Cheers!

    #645678

    nataliapinzon
    Participant

    I;m not sure I understand. I have the mail-chimp plugin running. I have separated out the code on the newsletter archives page as follows-

    In the custom CSS I put:

    .display_archive {font-family: arial,verdana; font-size: 12px;}
    .campaign {line-height: 125%; margin: 5px;}

    in the custom JS I put:

    <script language=”javascript” src=”http://us11.campaign-archive1.com/generate-js/?u=fb7ab3f06b4f70f53da5d2358&fid=2305&show=4″ type=”text/javascript”></script>​

    and now I dont get the archives anywhere on the page.

    I have a child theme running and I added the code that your recommended. but I got the following error:

    ” Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘add_my_script’ not found or invalid function name in /home/starwand/public_html/livetru.org/wp-includes/plugin.php on line 503″

    #645689

    nataliapinzon
    Participant

    Update – The code you recommended has been re added to the functions.php in the child theme – there is no error now ( I was missing a piece of it) .. but I have not yet been able to figure out how to get the archives to show up

    thank you
    Natalia

    http://livetru.org/newsletter-archives

    #645823

    Friech
    Moderator

    Hi Natalia,

    Where do you want exactly the list to appear? You could place the script on a RAW content element.

    <script language="javascript" src="http://us11.campaign-archive1.com/generate-js/?u=fb7ab3f06b4f70f53da5d2358&fid=2305&show=4" type="text/javascript"></script>​

    You would not see the list on the Cornerstone preview but it’ll show up on the front page.


    screenshot

    Hope it helps, Cheers!

    #646415

    nataliapinzon
    Participant

    Thank you! that worked!

    #646654

    Prasant Rai
    Moderator

    You are most welcome 🙂 .