I am trying to enqueue a couple of js files using something like this code:
function scripts_function()
{
wp_register_script('mapbox', 'http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js');
wp_enqueue_script('mapbox');
wp_register_script('myscript', plugins_url( 'my-js-file.js' , __FILE__ ));
wp_enqueue_script('myscript');
}
add_action('wp_enqueue_scripts', 'scripts_function');
And this works fine, as long as i use the "twentytwelve" theme wich i used while creating this plugin I' working on. But now I want to implement it on the HTML5 blank theme wich i was thinking about using as a startpoint for my theme, but then this just stops working, doesnt enqueue my my-js-file.js
, but the mapbox script hosted on cdnjs is included just fine.
If i inspect the code in the browser, i can see that where the script tag for my js-file should be there is just a script tag with a src attribute without a value:
<script type="text/javascript" src></script>
If i do print_r(plugins_url( 'my-js-file.js' , __FILE__ ));
, I get a path to my js file wich I can paste into the browser and that works fine.
What is going on here?