Skip to content

Instantly share code, notes, and snippets.

@raideus
Created April 27, 2012 16:43
Show Gist options
  • Save raideus/2510677 to your computer and use it in GitHub Desktop.
Save raideus/2510677 to your computer and use it in GitHub Desktop.
Example of using wp_enqueue_scripts() in WordPress
<?php
// Create a function to enqueue our scripts
function add_my_scripts() {
// Enqueue the modernizr script file and specify that it should be placed in the <head>
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/libs/modernizr-2.5.3.min.js', array(), '2.5.2', false );
}
// Run this function during the wp_enqueue_scripts action
add_action('wp_enqueue_scripts', 'add_my_scripts');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment