Copy the js
folder of the parent TwentySixteen
theme to child theme root. Then add the below code in your functions.php
–
function the_dramatist_dequeue_scripts() {
wp_dequeue_script( 'twentysixteen-script' );
wp_deregister_script( 'twentysixteen-script' );
}
add_action( 'wp_print_scripts', 'the_dramatist_dequeue_scripts' );
function the_dramatist_twentysixteen_scripts() {
wp_enqueue_script( 'twentysixteen-child-script', get_stylesheet_directory_uri() . '/js/functions.js', array( 'jquery' ), null, true );
}
add_action( 'wp_enqueue_scripts', 'the_dramatist_twentysixteen_scripts' );
Then in your child theme js
folder (the folder you copied earlier) find the functions.js
file and make your changes. It will give you the desired output.