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

    Hi, I want to override the aviapopup iframe JS on a child theme. How to disable the script?

    Something like this on the functions.php (*this is override the avia.js file):

    function wp_change_aviajs() {
    wp_dequeue_script( ‘avia-default’ );
    wp_enqueue_script( ‘avia-default-child’, get_stylesheet_directory_uri().’/js/avia.js’, array(‘jquery’), 2, true );
    }
    add_action( ‘wp_print_scripts’, ‘wp_change_aviajs’, 100 );

    My question is how to disable the JS wp_dequeue_script( ‘what_coming_here‘ );

    Thank you!

    • This topic was modified 6 years, 5 months ago by imokweb.
    #915271

    Hey imokweb,

    Thank you for using Enfold.

    The “avia-default” is the “avia.js” file. The code should disable the parent theme’s avia.js file.

    wp_dequeue_script( ‘avia-default’ );
    

    Best regards,
    Ismael

    #915438

    Thank you for your reply!

    I don’t want to override the avia.js, only the jquery.magnific-popup.js

    Is this possible?

    Thank you!

    #915816

    Hi,

    You should dequeue the “avia-popup” script and then enqueue it back in the child theme, same as the code above.

    wp_dequeue_script( 'avia-popup' );
    wp_enqueue_script( 'avia-popup-child', get_stylesheet_directory_uri().'/js/jquery.magnific-popup.js', array('jquery'), 2, true );
    

    Make sure that the directory and file names are correct.

    Best regards,
    Ismael

    #1116444

    The following is not fully working for me. The minified version and css are still loaded.
    wp_dequeue_script( ‘avia-popup’ );

    I see my custom script is loaded, but it isn’t used because of the other one still there. Any suggestions? How can I dequeue Avia popup?

    #1116656

    Hi,

    Did you enable the file compression? Toggle the compression from the Enfold > Performance panel after doing the file modification. That should regenerate the compressed or merged script.

    Best regards,
    Ismael

    #1116659

    Yes I tried that. Thats really not the problem.

    The problem is the Avia-popup is not getting dequeued.

    Is this still the way to dequeue the popup? Its not doing anything, its loading the minified script anyway.
    wp_dequeue_script( ‘avia-popup’ );

    #1116927

    Hi,

    What do you mean exactly by “minified script”? Are you referring to the compressed file (avia-footer-scripts.js) generated by the theme?

    We have to access the site in order to understand the issue better. Please post the login details in the private field.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.