CSS and JS in plugin
-
Hello,
I have written a small plugin just to access some information from an external table in the wordpress admin. The problem is that i am net being able to load any css or js. The generated page has the loading code in it but they all return and error 500. I get the same error if i try and call the css or js file directly from the browser.
Here’s the code i’m using to lead the files:
add_action(‘init’,’init’);
function init(){
$pluginUrl = home_url().”/wp-content/plugins/congresso_incricoes/”;
wp_register_script(‘jqueryui’, $pluginUrl.’/jquerysheet/jquery-ui/ui/jquery-ui.min.js’);
wp_register_script(‘jquerysheet’, $pluginUrl.’/jquerysheet/jquery.sheet.min.js’);
wp_register_style(‘sheetcss’,$pluginUrl.’jquerysheet/jquery.sheet.css’);
wp_register_style(‘uicss’,$pluginUrl.’jquerysheet/jquery-ui/theme/jquery-ui.css’);wp_enqueue_script(‘jqueryui’);
wp_enqueue_script(‘jquerysheet’);
wp_enqueue_style(‘sheetcss’);
wp_enqueue_style(‘uicss’);
wp_head();
}Does anyone have a clue as this might be happening?
Thanks in advance,
Luis
- The topic ‘CSS and JS in plugin’ is closed to new replies.