Hello there,
I wish to enqueue custom scripts on Enfold Child which depend on other scripts already loaded with the theme, such as Jquery and Magnific Popup. I would like to reference these dependencies in the wp_register_script function:
wp_register_script( 'my-custom-js-script', $template_url.'/js/my-custom-js-script.js', array('dependancy1, dependancy2, ...'), 1, true );
Do you have a list of references to scripts that are loaded with the Enfold theme that I can use for the dependencies array?
++Tx
Peter
Hey ifthen LLC,
You can take a look at the file functions.php where all the loading of scripts / styles is been hapenning.
let us know if you face any issue.
Best regards,
Basilis
@Basilis, thank you. I see all the references. If I am using the child theme functions.php and I enqueue a js script from their, will it recognize references like avia-shortcodes or avia-popup (in dependency array) from the parent theme? Just want to confirm this is the case.
++Tx
Peter
Hi Peter,
Not sure that magnific popup is a dependency, you might need to specify only jquery.
Best regards,
Victoria
If I have a custom script that uses avia-popup, for example, then I would need to specify as a dependency when enqueuing, right?
++Tx
Peter
Hi,
No need, if you added to be loaded last, it will be loaded last.
Best regards,
Basilis
@Basilis and @Victoria_d, thank you. I am done.
++Tx
Peter
Hi Peter,
Glad that Basilis and Victoria helped you. Thanks for using Enfold :)
Best regards,
Nikko