Skip to content

Instantly share code, notes, and snippets.

@Bradley-D
Created September 5, 2017 01:07
Show Gist options
  • Save Bradley-D/46934a0f49665907de61d0ebcc5138b5 to your computer and use it in GitHub Desktop.
Save Bradley-D/46934a0f49665907de61d0ebcc5138b5 to your computer and use it in GitHub Desktop.
// Replace WooCommerce product placeholder
function _custom_woocommerce_placeholder_img_src( $src ) {
$src = trailingslashit( get_template_directory_uri() ) . 'includes/images/placeholder.jpg'; // Change to required path and name
return $src;
}
add_filter( 'woocommerce_placeholder_img_src', '_custom_woocommerce_placeholder_img_src' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment