Created
May 20, 2015 20:30
-
-
Save remcotolsma/7b1f8a5a463c4891b5ff to your computer and use it in GitHub Desktop.
Enqueue FitVids.JS in WordPress.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueue scripts | |
*/ | |
function prefix_enqueue_scripts() { | |
$uri = get_template_directory_uri(); | |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
// FitVids - http://fitvidsjs.com/ | |
wp_register_script( | |
'fitvids', | |
$uri . "/assets/fitvids/jquery.fitvids$suffix.js", | |
array( 'jquery' ), | |
'1.1.0', | |
true | |
); | |
// Theme | |
wp_enqueue_script( | |
'theme', | |
$uri . "/js/script$suffix.js", | |
array( 'jquery', 'fitvids' ), | |
'1.0.0', | |
true | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment