Reply To: CSS in Child Theme style.css not given priority

Home Forums Support CSS in Child Theme style.css not given priority Reply To: CSS in Child Theme style.css not given priority

Home Forums Support CSS in Child Theme style.css not given priority Reply To: CSS in Child Theme style.css not given priority

#186320
Kyle Thomas

I’ve tried the code you suggested in my child theme function.php file but I couldn’t get it to take affect. Not sure what I’m missing or doing wrong.

add_action( 'wp_enqueue_scripts', 'generate_remove_scripts' );
function generate_remove_scripts() 
{
    wp_dequeue_style( 'generate-child' );
}

add_action( 'wp_enqueue_scripts', 'generate_move_scripts', 999 );
function generate_move_scripts() 
{
    if ( is_child_theme() ) :
        wp_enqueue_style( 'generate-child', get_stylesheet_uri(), true, filemtime( get_stylesheet_directory() . '/style.css' ), 'all' );
    endif;
}

Thanks for your help.