WordPress.org

Ready to get started?Download WordPress

Forums

MailChimp Widget
Javascript including error (1 post)

  1. janw.oostendorp
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by janw.oostendorp
  • This topic is not resolved
  • WordPress version: 3.4.2

Tags

No tags yet.