Hello, a client of mine is using this theme and we're doing some edits for them. We're making some edits to /js/init.js and overriding it in our child theme. Using the code you suggested here https://themenectar.ticksy.com/ticket/136919#comment-617536 doesn't work for us, so we're using this instead:
Which seems to be fine. Can you see any downside to this?
I was also wondering if it's possible to override just certain functions in init.js instead of the whole file? We're only making 2-3 edits and I presume this file gets updated once in a while, so would be ideal not to override the entire file in the child theme.
Yes thats the new correct method. I am afraid for now you will have to change the whole init.js file. Future updates would break it down so specific overrides are possible.
Hi Tahir, many thanks for the reply. OK, will have to keep an eye on updates for init.js. Would be great if specific overrides could be incorporated in the future.
Hello, a client of mine is using this theme and we're doing some edits for them. We're making some edits to /js/init.js and overriding it in our child theme. Using the code you suggested here https://themenectar.ticksy.com/ticket/136919#comment-617536 doesn't work for us, so we're using this instead:
wp_deregister_script('nectarFrontend', get_template_directory_uri() . '/js/init.js', array('jquery', 'superfish'), '7.0.7', TRUE);
Which seems to be fine. Can you see any downside to this?wp_register_script('nectarFrontend', get_stylesheet_directory_uri() . '/js/init.js', array('jquery', 'superfish'), '7.0.7', TRUE);
I was also wondering if it's possible to override just certain functions in init.js instead of the whole file? We're only making 2-3 edits and I presume this file gets updated once in a while, so would be ideal not to override the entire file in the child theme.
Hey ,
Yes thats the new correct method. I am afraid for now you will have to change the whole init.js file. Future updates would break it down so specific overrides are possible.
Best.
ThemeNectar Support Team
Hi Tahir, many thanks for the reply. OK, will have to keep an eye on updates for init.js. Would be great if specific overrides could be incorporated in the future.