Snippets

Crumina Team [All themes] Enquene changed scripts in child theme

Created by Alexandr Kostyrka last modified
add_action( 'wp_enqueue_scripts', 'crumina_child_theme_scripts', 99 );
function crumina_child_theme_scripts()
{
    wp_dequeue_script( 'reactor-js' ); // reactor-js: script ID (defined in inc/static.php)
    wp_deregister_script( 'reactor-js' );
    // Now the parent script is completely removed

    /*
     * Now enqueue you child js file, no need to register if you are not 
     * doing conditional loading
     */
    wp_enqueue_script( 'child-reactor-js', get_stylesheet_directory_uri() . '/reactor.js' ); // ID and link to file in child theme
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.