Placeholder image in WooCommerce
-
Hi,
Currently I use this snippet in my theme to add a placeholder image in case a product doesn’t have it’s own (featured) image:
function wc_custom_thumbnail() { function wc_custom_placeholder_img( $src ) { $src = get_stylesheet_directory_uri().'/images/product.jpg'; return $src; } add_filter('woocommerce_placeholder_img_src', 'wc_custom_placeholder_img'); } add_action( 'init', 'wc_custom_thumbnail' );
But I now notice
woocommerce_placeholder_img_src
is deprecated in 3.0.The placeholder snippet on the WooCommerce site isn’t updated.
So how can I set a placeholder now?
Guido
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Placeholder image in WooCommerce’ is closed to new replies.