Merubah Tampilan Gambar Default WooCommerce

Untuk merubah tampilan gambar default di Woo Commerce sesuai gambar yang kita inginkan, silahkan tambah kode ini pada functions.php di folder themes yang anda pakai (sebelum endif yang paling bawah).

add_action( ‘init’, ‘custom_fix_thumbnail’ );

function custom_fix_thumbnail() {
add_filter(‘woocommerce_placeholder_img_src’, ‘custom_woocommerce_placeholder_img_src’);

function custom_woocommerce_placeholder_img_src( $src ) {
$upload_dir = wp_upload_dir();
$uploads = untrailingslashit( $upload_dir[‘baseurl’] );
$src = $uploads . ‘/2017/04/placeholder.jpg’; // ini silahkan di rubah dengan nama file anda pada folder tahun dan bulan (induk di folder uploads).

return $src;
}
}

Selamat mencoba!

Views All Time
Views All Time
471
Views Today
Views Today
1
Rachmad Igen

Author: Rachmad Igen

Blogger, Social Media Marketing, Search Engine Marketing. I'm a Certified Digital Marketing Consultant.

Share This Post On

Submit a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This