• Resolved Trisha Cupra

    (@trishacupra)


    Just wanted to share how to exclude WooCommerce Products from getting the default featured image.

    function dfi_posttype_product ( $dfi_id, $post_id ) {
      $post = get_post($post_id);
      if ( 'product' === $post->post_type ) {
        return null; // the original featured image id
      }
    	return $dfi_id; // the image id
    }
    add_filter( 'dfi_thumbnail_id', 'dfi_posttype_product', 10, 2 );

    Hope that helps anyone looking for help with how to exclude one custom post type.

    https://wordpress.org/plugins/default-featured-image/

  • The topic ‘Solution: Exclude WooCommerce Product custom post type’ is closed to new replies.