Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #907272

    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

    #907599

    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

    #908000

    @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

    #908014

    Hi Peter,

    Not sure that magnific popup is a dependency, you might need to specify only jquery.

    Best regards,
    Victoria

    #908083

    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

    #908204

    Hi,

    No need, if you added to be loaded last, it will be loaded last.

    Best regards,
    Basilis

    #908205

    @Basilis and @Victoria_d, thank you. I am done.
    ++Tx
    Peter

    #908289

    Hi Peter,

    Glad that Basilis and Victoria helped you. Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Script references of dependancies for enqueueing custom script’ is closed to new replies.