Forum Replies Created
-
AuthorPosts
-
LinsLleisioMember
OK I solved it with help from the original link on wpsites.net. Just incase this helps anyone else this is what I did.
I cut the below from functions.php and pasted to front-page.php, line 25.
//* Enqueue Backstretch script and prepare images for loading
add_action( 'wp_enqueue_scripts', 'agency_enqueue_backstretch_scripts' );
function agency_enqueue_backstretch_scripts() {$image = get_option( 'agency-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );
//* Load scripts only if custom backstretch image is being used
if ( ! empty( $image ) ) {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' => str_replace( 'http:', '', $image ) ) );
}
}
LinsLleisioMemberMany thanks for your help... although I wanted every other page BUT home to just be a plain colour, I tried it though to see if it would work and it didn't have any effect whatsoever.
I already have the below in the css... which creates the 'flash' of background colour at load time of the page. And then the backstretch picture fades in. So I'm still wanting to remove the backstretch picture from all pages EXCEPT the home page.
body.agency-pro-red {
background-color: rgb(165, 32, 25);
}I'm still stumped and really appreciate any help or pointers. Thanks, Lins
-
AuthorPosts