Last active
August 29, 2015 14:07
-
-
Save srikat/f7fb04ef168506f04532 to your computer and use it in GitHub Desktop.
How to replace Home Section 1's background image with Backstretch slideshow in Parallax Pro. http://sridharkatakam.com/replace-home-section-1s-background-image-backstretch-slideshow-parallax-pro/
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
jQuery(document).ready(function($) { | |
// Create an array of images that you'd like to use | |
var images = [ | |
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-1.jpg', | |
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-3.jpg', | |
'http://websitesetuppro.com/demos/parallax-pro-copy/wp-content/themes/parallax-pro/images/bg-5.jpg' | |
]; | |
$('.home-section-1').backstretch(images, { | |
fade: 750, | |
duration: 4000 | |
}); | |
}); |
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
$images = apply_filters( 'parallax_images', array( '1', '3', '5' ) ); |
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
if ( is_active_sidebar( 'home-section-1' ) ) { | |
add_action( 'wp_enqueue_scripts', 'sk_enqueue_backstretch' ); | |
function sk_enqueue_backstretch() { | |
wp_enqueue_script( 'backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/jquery.backstretch.min.js', array( 'jquery' ), '', true ); | |
wp_enqueue_script( 'backstretch-init', get_stylesheet_directory_uri() . '/js/backstretch-init.js', array( 'backstretch' ), '1.0.0', true ); | |
} | |
} |
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
$images = apply_filters( 'parallax_images', array( '3', '5' ) ); |
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
$opts = apply_filters( 'parallax_images', array( '3', '5' ) ); |
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
$opts = apply_filters( 'parallax_images', array( '1', '3', '5' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment