Comments Margrethe started the conversationOctober 30, 2020 at 11:06amI have tried to deregister Salient init.js and use my own init.js, but nothing changes and the parent theme init.js is still loaded. What am I doing wrong?Added this to my child themes function file: add_action('wp_enqueue_scripts', 'unhook_parent_script',20 ); function unhook_parent_script() { wp_deregister_script('nectarFrontend', get_template_directory_uri() . '/js/init.js', array('jquery', 'superfish'), $nectar_theme_version, TRUE); wp_register_script('nectarFrontend', get_stylesheet_directory_uri() . '/js/init.js', array('jquery', 'superfish'), $nectar_theme_version, TRUE); } 1,075ThemeNectar repliedOctober 30, 2020 at 9:22pmHey Margrethe, the snippet you posted was close, but it needs to be modified a little add_action('wp_enqueue_scripts', 'unhook_parent_script',20 ); function unhook_parent_script() { $nectar_theme_version = nectar_get_theme_version(); wp_deregister_script('nectar-frontend'); wp_register_script('nectar-frontend', get_stylesheet_directory_uri() . '/js/init.js', array('jquery', 'superfish'), $nectar_theme_version, TRUE); } Cheers Sign in to reply ...
I have tried to deregister Salient init.js and use my own init.js, but nothing changes and the parent theme init.js is still loaded. What am I doing wrong?
Added this to my child themes function file:
Hey Margrethe, the snippet you posted was close, but it needs to be modified a little
Cheers