404 when enqueue_script using plugin_url
So i'm adding a script into my site via functions.php
that lives in the plugins directory. The code is pretty straightforward:
function add_jq_script() {
wp_register_script('r_footer', plugins_url('/responsiveFooter.js', __FILE__), array('jquery'),'1.1', true);
wp_enqueue_script('r_footer');
}
add_action( 'wp_enqueue_scripts', 'add_jq_script', 999 );
the plugins seem to be working on local site, but in dev console, i'm getting a 404 that seems to be concatting my site-url and the absolute url for my plugins:
http://localhost/~thisuser/wordpress/wp-content/plugins/Users/thisuser/Sites/wordpress/wp-content/themes/liberty/responsiveFooter.js?ver=1.1
i'm a bit new to wordpress, the url should be http://localhost/~thisuser/wordpress/wp-content/plugins/responsiveFooter.js
is there some wp-option i need to change or some plugin setting somewhere to fix this?
Topic plugins-url functions wp-enqueue-script Wordpress
Category Web