SHOW:
|
|
- or go back to the newest paste.
1 | - | //* Conditionally remove the Featured Product Image from the single-product page |
1 | + | //* Conditionally remove the Featured Product Image from the single-product page |
2 | - | function remove_gallery_and_product_images() { |
2 | + | function remove_gallery_and_product_images() { |
3 | - | if ( is_product() && is_single(array(1092, 1093, 1094) ) ) { |
3 | + | if ( is_product() && is_single(array(1092, 1093, 1094) ) ) { |
4 | - | remove_action( 'woocommerce_before_single_product_summary', |
4 | + | remove_action( 'woocommerce_before_single_product_summary', |
5 | - | 'woocommerce_show_product_images', 20 ); |
5 | + | 'woocommerce_show_product_images', 20 ); |
6 | - | add_filter('body_class', 'no_prod_imgs_class'); |
6 | + | add_filter('body_class', 'no_prod_imgs_class'); |
7 | - | } |
7 | + | } |
8 | } | |
9 | - | add_action('template_redirect', 'remove_gallery_and_product_images'); |
9 | + | add_action('template_redirect', 'remove_gallery_and_product_images'); |
10 | - | |
10 | + | |
11 | - | //* Add CSS for removed featured images from multiple specific product detail |
11 | + | //* Add CSS for removed featured images from multiple specific product detail |
12 | - | pages |
12 | + | pages |
13 | - | function no_prod_imgs_class($classes) { |
13 | + | function no_prod_imgs_class($classes) { |
14 | - | $classes[] = 'no-product-images'; |
14 | + | $classes[] = 'no-product-images'; |
15 | - | return $classes; |
15 | + | return $classes; |
16 | } |