Put this code in your plugin

function your_css_and_js() {
wp_register_style('your_css_and_js', plugins_url('style.css',__FILE__ ));
wp_enqueue_style('your_css_and_js');
wp_register_script( 'your_css_and_js', plugins_url('your_script.js',__FILE__ ));
wp_enqueue_script('your_css_and_js');
}
add_action( 'admin_init','your_css_and_js');

if you need to add it to theme, then


function your_css_and_js() {
wp_register_style('your_css_and_js', theme_url('style.css',__FILE__ ));
wp_enqueue_style('your_css_and_js');
wp_register_script( 'your_css_and_js', theme_url('your_script.js',__FILE__ ));
wp_enqueue_script('your_css_and_js');
}
add_action( 'admin_init','your_css_and_js');

This page has been readed 119 times

Leave a Reply

Your email address will not be published. Required fields are marked *