Last active
June 4, 2018 20:42
-
-
Save landbryo/e4fd2234759d76c4c06b47e4281c6be8 to your computer and use it in GitHub Desktop.
If you are using the Enfold WordPress theme, it is likely that you'll need to make modifications to its main script avia.js. This is how you can safely copy the avia.js file to your child theme and make modifications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* enqueue child script if not in dashboard */ | |
if (!(is_admin())) { | |
function change_aviajs() { | |
wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); | |
} | |
add_action( 'wp_print_scripts', 'change_aviajs', 100 ); | |
} | |
/* dequeue child script */ | |
function dequeue_aviajs() { | |
wp_dequeue_script( 'avia-default' ); | |
} | |
add_action( 'wp_print_scripts', 'dequeue_aviajs', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment