If you want custom image sizes (width and height) for catalog add this code in functions.php:
add_image_size( 'oxygen-catalog-custom-image-size', 300, 200, true ); // "true" means the image will be cropped
function custom_catalog_image_size() {
return 'oxygen-catalog-custom-image-size';
}
add_filter( 'oxygen_shop_loop_thumb', 'custom_catalog_image_size', 100 );
Apply your own dimensions (replace 300 and 200), then regenerate images and it should work fine for you.
For single product images add the following code:
add_image_size( 'oxygen-single-custom-image-size', 500, 350, true ); // "true" means the image will be cropped
function custom_single_product_image_size() {
return 'oxygen-single-custom-image-size';
}
add_filter( 'oxygen_shop_single_thumb', 'custom_single_product_image_size', 100 );
This also requires thumbnails regenerate, so once you apply both codes, you can do thumbnail re-generation.
An important note: The dimensions you set for thumbnails, they will only applied if the image is larger than specified dimensions.
If for example you have made shop single products to have image size of 500x350 and there is an image for example with this size: 400x400 then the width is smaller than required one and it won't be resized, thus it will be used that one.
So it is best, after you create your product images, to prepare them for catalog, so you can create a standard image size (using photoshop or any other image editing software) in these cases.
Hi Bodys, I need a further assistence because I have Image Problems.
I need fix sizes for all three kinds of images.
catalog
productdetail
and product
further
how can I set css for each imagetype.
I get ill, because one image is great, the other one is small, damned-
can you help me?
regards
Stephan
Hi Stephan,
Well, it depends whether you are using "proportional" thumbnails and in this case all thumbnails will have their own height.
To avoid this, for catalog pages set Default image size:
(view large version)
If you want custom image sizes (width and height) for catalog add this code in functions.php:
Apply your own dimensions (replace 300 and 200), then regenerate images and it should work fine for you.
For single product images add the following code:
This also requires thumbnails regenerate, so once you apply both codes, you can do thumbnail re-generation.
An important note: The dimensions you set for thumbnails, they will only applied if the image is larger than specified dimensions.
If for example you have made shop single products to have image size of 500x350 and there is an image for example with this size: 400x400 then the width is smaller than required one and it won't be resized, thus it will be used that one.
So it is best, after you create your product images, to prepare them for catalog, so you can create a standard image size (using photoshop or any other image editing software) in these cases.