Skip to content

Instantly share code, notes, and snippets.

@raiden808
Created September 24, 2018 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raiden808/7c229c28cbc2a293ead311702d157369 to your computer and use it in GitHub Desktop.
Save raiden808/7c229c28cbc2a293ead311702d157369 to your computer and use it in GitHub Desktop.
Hide featured image on specific products
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