can remove first image before run javascript ?

on core woocommerce gallary can disable use function below
your plugin can remove it before run slick.js ?

add_filter(‘woocommerce_single_product_image_thumbnail_html’, ‘remove_featured_image’, 10, 2);
function remove_featured_image($html, $attachment_id ) {
global $post, $product;
$featured_image = get_post_thumbnail_id( $post->ID );
if ( $attachment_id == $featured_image )
$html = ”;
return $html;
}

2 Replies

  • Participant

    have solution for delete features image , rewrite code example below

    apply_filters( ‘woocommerce_single_product_image_html’, ‘prim_single_product_image’, 10, 3 );

    function prim_single_product_image($watermark_class,$popup_link,$datatype, $image_title, $image, $post_id, $html ) {

    $html = ”;
    $html = ‘‘.$image.’‘;
    $html = ”;

    return $html;

    }

  • Participant

    can’t use code in topic

Your Answer