Hello,
I am trying to load a javascript that adds a snow effect on our site. I tried editing the head.php file and simply adding the <script src=”snowstorm.js”></script> code, as suggested by the script author, but this didn’t work. I then looked up info on loading scripts and tried editing functions.php with the following code:
<?php
define('ETHEME_DOMAIN', 'legenda');
require_once( get_template_directory() . '/framework/init.php' );
function wpb_adding_scripts() {
wp_register_script('snowstorm', plugins_url('snowstorm.js', __FILE__), array('jquery'),'1.1', false);
wp_enqueue_script('snowstorm');
}
add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
?>
But it didn’t work either. Could you help?