Last active
December 11, 2015 18:19
-
-
Save bradpotter/4640582 to your computer and use it in GitHub Desktop.
Enqueue fitvids from https://github.com/davatron5000/FitVids.js | Props to @realFATmedia & @krogsgard
This file contains hidden or 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
// Add to functions file | |
add_action('wp_enqueue_scripts', 'child_javascript_files'); | |
function child_javascript_files() { | |
wp_register_script( 'fitvids', get_stylesheet_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '1.0', true ); | |
wp_register_script( 'loadfitvids', get_stylesheet_directory_uri() . '/js/load.fitvids.js', array('fitvids'), '1.0', true ); | |
wp_enqueue_script( 'fitvids' ); | |
wp_enqueue_script( 'loadfitvids' ); | |
} | |
// Create a file named load.fitvids.js and enter the following | |
jQuery(document).ready(function($){ | |
// Target your .container, .wrapper, .post, etc. | |
$(".videowrap").fitVids(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment