wordpress - Custom plugin wont load my CSS -
i'm creating wordpress plugin custom js , css. codes adding js file code perfectly, not css. css file in same folder plugin. heres how i'm attempting load them in:
add_action( 'wp_enqueue_scripts', 'addjs' ); add_action('admin_enqueue_scripts', 'addcss'); function addjs() { wp_register_script( 'registeruser', plugins_url( 'registeruser.js', __file__ ) ); wp_enqueue_script( 'registeruser'); } function addcss() { wp_register_style( 'cafe', plugins_url('cafe.css')); wp_enqueue_style( 'cafe' ); }
you need add __file__
css enqueue , using "admin" loads files on admin pages. unless want happen need use same call js files
Comments
Post a Comment