Support » Plugin: MailChimp Widget » [Plugin: MailChimp Widget] Javascript including error

  • Hi I like you plugin but you include JS wrong:
    ns_widget_mailchimp.class.php line:40

    you put in:
    wp_enqueue_script('ns-mc-widget', get_bloginfo('wpurl') . '/wp-content/plugins/mailchimp-widget/js/mailchimp-widget-min.js', array('jquery'), false);

    Now I’m running a site where the I moved the wp-content folder. So it isn’t working. Like markjaquith’s Skelleton.

    You should use
    wp_enqueue_script('ns-mc-widget', plugins_url('/js/mailchimp-widget-min.js', __FILE__), array('jquery'), false);

    But since the file isn’t in the root of the site you have to use:
    wp_enqueue_script('ns-mc-widget', str_replace( '/lib/', '/', plugin_dir_url(__FILE__)).'/js/mailchimp-widget-min.js', array('jquery'), false);

    This will work. It’s a lot better and flexible for everybody.

  • The topic ‘[Plugin: MailChimp Widget] Javascript including error’ is closed to new replies.