Jump to content
Search Community
mockingbird test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello , and Welcome to the GreenSock forum!

You can view some of these forum topics:

 

http://greensock.com/forums/index.php?app=core&module=search&do=search&fromMainBar=1&search_app=forums:forum:11&search_term=wordpress%20enqueue

 

For WordPress you have to enqueue the script file so Wordpress can queue it and run it on the frontend

 

wp_enqueue_script: https://developer.wordpress.org/reference/functions/wp_enqueue_script/

<?php
// add this code snippet in your wordpress functions.php
// The proper way to enqueue GSAP script
// wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
function theme_gsap_script() {
    wp_enqueue_script( 'gsap-js', 'http://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js', array(), false, true );
}
add_action( 'wp_enqueue_scripts', 'theme_gsap_script' );
?>

Other helpful info on Wordpress Codex:

 

https://codex.wordpress.org/Using_Javascript

 

Howe this helps!

:)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...