parent
ad1073c212
commit
53b7844412
|
@ -45,13 +45,13 @@ $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_cl
|
|||
);
|
||||
|
||||
if ( has_post_thumbnail() ) {
|
||||
$html = '<figure data-thumb="' . get_the_post_thumbnail_url( $post->ID, 'shop_thumbnail' ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
|
||||
$html = '<div data-thumb="' . get_the_post_thumbnail_url( $post->ID, 'shop_thumbnail' ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
|
||||
$html .= get_the_post_thumbnail( $post->ID, 'shop_single', $attributes );
|
||||
$html .= '</a></figure>';
|
||||
$html .= '</a></div>';
|
||||
} else {
|
||||
$html = '<figure class="woocommerce-product-gallery__image--placeholder">';
|
||||
$html = '<div class="woocommerce-product-gallery__image--placeholder">';
|
||||
$html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src() ), esc_html__( 'Awaiting product image', 'woocommerce' ) );
|
||||
$html .= '</figure>';
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, get_post_thumbnail_id( $post->ID ) );
|
||||
|
|
|
@ -38,9 +38,9 @@ if ( $attachment_ids && has_post_thumbnail() ) {
|
|||
'data-large-image-height' => $full_size_image[2],
|
||||
);
|
||||
|
||||
$html = '<figure data-thumb="' . esc_url( $thumbnail[0] ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
|
||||
$html = '<div data-thumb="' . esc_url( $thumbnail[0] ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
|
||||
$html .= wp_get_attachment_image( $attachment_id, 'shop_single', false, $attributes );
|
||||
$html .= '</a></figure>';
|
||||
$html .= '</a></div>';
|
||||
|
||||
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue