Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nickburne/1bb04e69c11478dfc925 to your computer and use it in GitHub Desktop.
Save nickburne/1bb04e69c11478dfc925 to your computer and use it in GitHub Desktop.
Add a background image to the shop page only in WooCommerce
add_filter( 'wp_head', 'wo_custom_shop_background' );
function wo_custom_shop_background() {
if( is_shop() && !is_admin() ) {
?>
<style>
body {
background: url(http://blogs.smithsonianmag.com/smartnews/files/2013/08/06177001.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment