Where to Add Customizr Child Javascript
-
I am new to WordPress development. I have successfuly added a child theme to the customizr theme. I know this because the css in my style.css work fine. However I need to add some custom javascript files and I have not yet been successful. Here is the code:
function theme_javascript(){if(is_page('retreats')){
// Deregister scripts
wp_deregister_script('ecwidapi');
wp_deregister_script('mytempo');// Register jSon template
wp_register_script('mytempo',get_template_directory_uri().'/js/tempo.js');// Register ECWID api
wp_register_script('ecwidapi',get_template_directory_uri().'/js/ecwidapi.js',array('jquery'));wp_enqueue_script('mytempo');
wp_enqueue_script('ecwidapi');
}
}add_action(‘wp_enqueue_scripts’,’theme_javascript’);
I want to remove this from the customizr functions.php file (where I have it now) and put it properly somewhere in a file in the child theme. Copying the functions.php file to the child directory and adding this code hasn’t worked.
Thank you advance for your instruction.
John
The topic ‘Where to Add Customizr Child Javascript’ is closed to new replies.
