Tagged: enfold, Enfold child, iframe, pop-up
-
AuthorPosts
-
February 20, 2018 at 8:38 pm #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, 9 months ago by imokweb.
February 21, 2018 at 5:55 am #915271Hey 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,
IsmaelFebruary 21, 2018 at 1:57 pm #915438Thank you for your reply!
I don’t want to override the avia.js, only the jquery.magnific-popup.js
Is this possible?
Thank you!
February 22, 2018 at 3:19 am #915816Hi,
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,
IsmaelJuly 7, 2019 at 2:12 pm #1116444The 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?
July 8, 2019 at 1:43 pm #1116656Hi,
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,
IsmaelJuly 8, 2019 at 1:45 pm #1116659Yes 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’ );July 9, 2019 at 6:45 am #1116927 -
AuthorPosts
- You must be logged in to reply to this topic.