Created
September 24, 2018 01:42
-
-
Save raiden808/7c229c28cbc2a293ead311702d157369 to your computer and use it in GitHub Desktop.
Hide featured image on specific products
This file contains 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
add_filter('woocommerce_single_product_image_thumbnail_html', 'remove_featured_image', 10, 3); | |
//hides featured image progmatically | |
function remove_featured_image($html, $attachment_id, $post_id) { | |
$featured_image = get_post_thumbnail_id($post_id); | |
$filtered_products = array(271479); | |
if(in_array($post_id, $filtered_products)){ | |
return ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment