Skip to content

Instantly share code, notes, and snippets.

@jayj
Created June 3, 2011 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayj/1006150 to your computer and use it in GitHub Desktop.
Save jayj/1006150 to your computer and use it in GitHub Desktop.
// Register all the javascript and css we need to accompany those scripts
add_action( 'wp_enqueue_scripts', 'html5press_register_scripts' );
add_action( 'wp_print_styles', 'html5press_register_styles' );
function html5press_register_scripts() {
/**
* Modernizr enables HTML5 elements & feature detects
* For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
*/
wp_enqueue_script( 'modernizr', get_stylesheet_directory_uri() . '/js/modernizr-2.0.min.js', '', '2.0' );
wp_enqueue_script( 'respond', get_stylesheet_directory_uri() . '/js/respond.min.js', array( 'modernizr' ), '1.0' );
// Make sure jQuery is loaded after Modernizr
wp_deregister_script( 'jquery' );
wp_enqueue_script( 'jquery', includes_url( 'js/jquery/jquery.js' ), array( 'modernizr' ), null );
global $html5press_options; $html5press_settings = get_option( 'html5press_options', $html5press_options );
// If back to top is enabled, add easing and the back to top javascript.
if ( $html5press_settings['back_to_top'] == 1 ) {
wp_enqueue_script( 'easing', get_stylesheet_directory_uri() . '/js/easing.min.js', array( 'jquery' ), '1.1.2', true );
wp_enqueue_script( 'totop', get_stylesheet_directory_uri() . '/js/jquery.ui.totop.js', array( 'jquery' ), '1.1', true );
}
wp_enqueue_script( 'bxslider', get_stylesheet_directory_uri() . '/js/jquery.bxSlider.min.js', array( 'jquery' ), '3.0', true );
wp_enqueue_script( 'bxslider-load', get_stylesheet_directory_uri() . '/js/bxslider-load.js', array( 'bxslider' ), '1.0', true );
}
function function html5press_register_styles() {
wp_enqueue_style( 'bxslider-style', get_stylesheet_directory_uri().'/css/bx_styles.css');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment