Comments 3Pietro started the conversationJanuary 18, 2018 at 6:50pmHi there, I know there's a theme function to upload custom CSS, but I wan't to use a .css file as it's more professional, fast and easy to use. I can't find a way to enque my child theme style after the parent's one. I've even tried function dequeue_styles() {// this removes the original stylewp_dequeue_style( 'style-css' );wp_deregister_style( 'style-css' );wp_dequeue_style( 'oxygen-main-css' );wp_deregister_style( 'oxygen-main-css' );}add_action( 'wp_enqueue_scripts', 'dequeue_styles', 10 ); But they still stay there. Please help me out as i don't want use !important. Thanks[deleted] repliedJanuary 19, 2018 at 10:07amHi Pietro,By default, Child Theme will enqueue the style below oxygen.css and style.css of parent theme: (view large version)As you can see "1" is the Oxygen main style and then after it "2" loads.The child theme has the priority of enqueue set to 100: <?php/** * Oxygen WordPress Theme * * Laborator.co * www.laborator.co */// This will enqueue style.css of child themefunction enqueue_childtheme_scripts() { wp_enqueue_style( 'oxygen-child', get_stylesheet_directory_uri() . '/style.css' );}add_action( 'wp_enqueue_scripts', 'enqueue_childtheme_scripts', 100 );So consider replacing it with this form.However if you want to dequeue oxygen.css entirely then you can use wp_dequeue_style( 'oxygen-main' )and that should do the trick. 3Pietro repliedJanuary 23, 2018 at 10:16amHi and thanks Arlind, I was dequeueing incorrectly, calling it oxygen-main-css.Regards Sign in to reply ...
Hi there,
I know there's a theme function to upload custom CSS, but I wan't to use a .css file as it's more professional, fast and easy to use.
I can't find a way to enque my child theme style after the parent's one.
I've even tried
But they still stay there.
Please help me out as i don't want use !important.
Thanks
Hi Pietro,
By default, Child Theme will enqueue the style below oxygen.css and style.css of parent theme:
(view large version)
As you can see "1" is the Oxygen main style and then after it "2" loads.
The child theme has the priority of enqueue set to 100:
So consider replacing it with this form.
However if you want to dequeue oxygen.css entirely then you can use
wp_dequeue_style( 'oxygen-main' )
and that should do the trick.Hi and thanks Arlind,
I was dequeueing incorrectly, calling it oxygen-main-css.
Regards