I am trying to convert html to wordpress. The code in the html was:
<script src="js/jquery.nicescroll.min.js"></script>
<script src="js/jquery.js"></script> ( jQuery v1.7.2 )
and The inline script
$(document).ready(
function() {
$("html").niceScroll();
}
); and much more.
In wordpress functions.php , I added this
if ( ! function_exists( 'your_enqueue' ) ) :
function your_enqueue(){
wp_enqueue_script(' name ', get_template_directory_uri(). '/script.js' , array('jquery')), '1.0', false);
}
endif;
add_action('wp_enqueue_scripts', 'your_enqueue');
I created a new .js file named script.js and added the following code in it:
<script src="js/jquery.nicescroll.min.js"></script>
$(document).ready(
function() {
$("html").niceScroll();
}
);
Is it right way to do this? Will it work? and Wordpress by default uses jQuery v1.7.2 or have to do some coding again in functions.php