Created
October 29, 2016 13:33
-
-
Save MinaPansuriya/17e5a4e9ea64ac0fe359df9e3de801b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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