I am working on a plugin which loads its own css for front end and it is working fine. But the same css is also being applied for admin dashboard. i want to prevent the plugin css loading in admin dashboard.
I have registered the css styles and enqeued prpperly to init
but not able to understand what is causing the css to be loaded inside admin dashboard.
Below is the code I used to register and enqeue the stylesheet.
function skillapp_css(){
wp_register_style('sh_css', plugins_url('assets/css/styles.css', __FILE__), false, 1.1);
wp_enqueue_style('sh_css');}add_action('init', 'skillapp_css');
You’re hooking too early. For styles and scripts you should be hooking to
wp_enqueue_scripts
for front end resources oradmin_enqueue_scripts
for admin resources.