Skip to content

Instantly share code, notes, and snippets.

@mrjonwilson
Created May 6, 2014 03:15
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 mrjonwilson/c6ae1ed9b70d488ac423 to your computer and use it in GitHub Desktop.
Save mrjonwilson/c6ae1ed9b70d488ac423 to your computer and use it in GitHub Desktop.
Backstretch For Genesis
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {
//* Load scripts only if custom background is being used
if ( ! get_background_image() ) //Do I add something here?
return;
wp_enqueue_script( 'agency-pro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_script( 'agency-pro-backstretch-set', get_bloginfo( 'stylesheet_directory' ).'/js/backstretch-set.js' , array( 'jquery', 'agency-pro-backstretch' ), '1.0.0' );
wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment