I'm in Wordpress 4.5.2 on Windows 10 and I'm trying to register and enqueue my stylesheet in Wordpress, but it just isn't working. I'm having the same problem with jQuery.
I have this code in a plugin, and I am displaying a dashboard widget, which is working just fine:
<?php
/*
* Plugin Name: TEST PLUGIN
*/
/* register styles and scripts
* register dash widgets
*
*/
function register_styles() {
wp_register_script( 'wildstyle', plugins_url('css/wildstyle.css', __FILE__ ) );
wp_enqueue_script( 'wildstyle' );
}
function register_dash_widget() {
wp_add_dashboard_widget(
'test-widget',
'Test Widget',
'display_callback'
);
}
/* add all the actions
*
*
*/
add_action( 'wp_enqueue_scripts', 'register_styles' );
add_action( 'wp_dashboard_setup', 'register_dash_widget' );
/* display callback for dashboard metabox
*
*
*/
function display_callback() {
echo '<p>Testing, testing...</p>';
}
Here is the little bit of css that I'm using for the test:
p {
color: red;
}
Why is my text not red?