In my website i have a slider that loads the 620*620 size of the products picture. I want to load other size of this picture (the sizes that i want are created in wordpress gallery but i dont know how to load them).
the default picture size in “woocomerce_thumbnail” .
what is the other size that i can use ?
i found something here but how i can change this default size? (what is the other sizes that i can use ?)
if (!function_exists( 'woocommerce_get_product_thumbnail' ) ) {
/**
* Get the product thumbnail, or the placeholder if not set.
*
* @param string $size (default: 'woocommerce_thumbnail').
* @param int $deprecated1 Deprecated since WooCommerce 2.0 (default: 0).
* @param int $deprecated2 Deprecated since WooCommerce 2.0 (default: 0).
* @return string
*/
function woocommerce_get_product_thumbnail( $size = 'woocommerce_thumbnail', $deprecated1 = 0, $deprecated2 = 0 ) {
global $product;
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
return $product ? $product->get_image( $image_size ) : '';
}
}
2
Answers
You can find the above and information on defining custom sized here.
Re-check your theme support
add_theme_support('post-thumbnails');
For only woocommerce you can try this
For Default WordPress Thumbnail
If You need a specific resolutions
Post Thumbnail Linking to Large Image Size you can change the size by changing
large
You can also create custom featured image sizes in your theme’s functions
Here is an example of how to create custom Featured Image sizes in your theme’s
functions.php
file.Displaying additional image sizes in your WordPress theme