Code:
function my_customize_scripts(){
wp_register_script('my-customizer-js', get_template_directory_uri() .'/js/customizer.js', array('jquery'), 1.0, true);
wp_enqueue_script('my-customizer-js');
}add_action('customize_controls_enqueue_scripts', 'my_customize_scripts', 1);
jQuery file enqueue with hook
Code:
customize_controls_enqueue_scripts
Code:
.change()
This file,
Code:
customizer.js
Code:
customize_controls_enqueue_scripts
This is how jQuery code wrapped in
Code:
customizer.js
Code:
jQuery(document).ready(function($){
//code here
}
inside has
Code:
change()
I tried to
Code:
wp_derejister_script('jquery');
Code:
wp_head
Code:
header.php
Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
and it worked, but it's not an option. I want the Wordpress core jQuery run on my website.
I tried to undo all the changes that I've done to
Code:
customizer.js
But the
Code:
alert();
So please, any help is appreciated.
P.S. I checked other js files, as I can see they work fine. I also tried to enqueue customizer.js the general way
Code:
wp_enqueue_script()
This is my first time I am asking question here, this is my last hope.