Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created December 30, 2014 09:57
Show Gist options
  • Save lmartins/0760a0545225eb3fda5b to your computer and use it in GitHub Desktop.
Save lmartins/0760a0545225eb3fda5b to your computer and use it in GitHub Desktop.
Replace WooCommerce default thumbnail placeholder
/*
* goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :)
*/
add_action( 'init', 'custom_fix_thumbnail' );
function custom_fix_thumbnail() {
add_filter('woocommerce_placeholder_img', 'custom_woocommerce_placeholder_img');
function custom_woocommerce_placeholder_img( $src ) {
$src = '<span class="thumb-placeholder"><i class="icon-camera"></i></span>';
return $src;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment