Reply To: Load child theme css after plugin stylesheets

Home Forums Support Load child theme css after plugin stylesheets Reply To: Load child theme css after plugin stylesheets

#165194
Tom
Lead Developer
Lead Developer

Ah, I gotcha πŸ™‚

You should be able to do it like this:

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;
}

Let me know πŸ™‚