Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MinaPansuriya/17e5a4e9ea64ac0fe359df9e3de801b0 to your computer and use it in GitHub Desktop.
Save MinaPansuriya/17e5a4e9ea64ac0fe359df9e3de801b0 to your computer and use it in GitHub Desktop.
/**
* @Title: WooCommerce Change Default Placeholder image for Product page
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_action( 'init', 'ccw_custom_woo_placeholder' );
function ccw_custom_woo_placeholder(){
add_filter('woocommerce_placeholder_img_src','pbs_woo_product_placeholder_img_src');
function pbs_woo_product_placeholder_img_src($src){
// Here replace your image attachment ID with 2966
$src = wp_get_attachment_url(2966);
return $src;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment