Hàm lấy ảnh chuẩn ảnh đại diện sản phẩm

  Akasa Code WP

Hàm này lấy chuẩn ảnh woocommerce thumbnail khi sản phẩm hiển thị trên trang chủ, danh mục sản phẩm, wiget…..

the_post_thumbnail( 'shop_catalog' );

Cấu hình tỉ lệ ảnh đại diện sản phẩm: Giao diện => Tùy biến => Woocommerce => Ảnh sản phẩm

Tham khảo thêm lấy ảnh đại diện:

1
2
3
4
5
6
7
8
9
10
11
//Default WordPress
the_post_thumbnail( 'thumbnail' );     // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' );        // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' );  // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' );         // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' );          // Full resolution (original size uploaded)
//With WooCommerce
the_post_thumbnail( 'shop_thumbnail' ); // Shop thumbnail (180 x 180 hard cropped)
the_post_thumbnail( 'shop_catalog' );   // Shop catalog (300 x 300 hard cropped)
the_post_thumbnail( 'shop_single' );    // Shop single (600 x 600 hard cropped)
0 0 đánh giá
Đánh giá bài viết
Please wait...
Theo dõi
Thông báo của
0 Góp ý
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận