Hi, I am not a javascript expert but I need to add Greensock Tweenmax to my wordpress website via my Child Theme. I've seen so many different sources explaining different ways of doing this but none have worked. Can anyone explain this OR send me to a resource that's going to work for me?
Right now I have installed this code into my <body> tag:
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.2.6/gsap.min.js"></script>
And this into <footer>:
<script src="<?php echo get_template_directory_uri(); ?>/app.js"></script>
I created a new file in my child theme folder called app.js,
and in my child theme functions.php, tried to encue it as so:
function my_custom_scripts() {
wp_enqueue_script( 'app-js', get_stylesheet_directory_uri() . '/app.js', array( 'jquery' ),'',true );
}
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );