Created
May 6, 2014 03:15
-
-
Save mrjonwilson/c6ae1ed9b70d488ac423 to your computer and use it in GitHub Desktop.
Backstretch For Genesis
This file contains 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_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