Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: need help stretching background image in IE

@mattg123

Participant

alright well here, your code should look like this

 function backstretch_script() {
 
		wp_register_script( 'backstretch', get_stylesheet_directory_uri() . '/_inc/js/backstretch.js', 'jquery', '1.8.3', true);
        wp_enqueue_script( 'backstretch' );
    
}
add_action( 'wp_enqueue_scripts', 'backstretch)script' );

the get_stylesheet_directory_uri refers to where you’ve put backstretch.js, so you may need to change that. Once you’ve added that code you can then use wp_footer(); to use the plugin like so


	function backstretch_add() {
?>
        <script type="text/javascript">
            jQuery.backstretch("<?php echo get_stylesheet_directory_uri()?>/_inc/images/background.jpg");
        </script>
<?php
	}
add_action ('wp_footer', 'backstretch_add', 20);

note – you’ll have to change the code between “” to use your image

hope that helps @diabolique65

Skip to toolbar