No problem with the scripts being queuing up and showing up.
The stylesheet, however, fails to ever show up.
I am hooking into:
add_action( "admin_print_scripts-post-new.php", array($this, 'cs_edit_scripts') ); add_action( "admin_print_scripts-post.php", array($this, 'cs_edit_scripts') );
I do this as follows: (the extra variable assignments at the top are just a result of me trying to figure things out over time…)
// Get the path to our plugin directory, and then append the js/whatever.js $js_path = plugins_url('/js/ui.datepicker.min.js', __FILE__); $cs_path = plugins_url('/js/cs-datepicker.js', __FILE__); $style_path = plugins_url('/css/ui-lightness/jquery-ui-1.7.3.custom.css', __FILE__); wp_register_style('pkstyles', $style_path); wp_enqueue_style('pkstyles'); wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-ui-datepicker', $js_path, array('jquery','jquery-ui-core') ); // enqueue our own script that makes datepicker work the way we want wp_enqueue_script('cs-datepicker', $cs_path, array('jquery','jquery-ui-core','jquery-ui-datepicker') );
I have double and triple checked the path of the css file, etc.
After two days of searching, I’m posting this here, and someone will probably point out that I missed a semicolon or something silly.
Thanks for any help.
- The topic ‘wp_enqueue_style not working’ is closed to new replies.