Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Enqueue FitVids.JS in WordPress.
<?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
You can’t perform that action at this time.