This topic has 9 replies, 2 voices, and was last updated 8 years, 10 months ago ago by Jack Richardson
Hey together,
I would like to crop the category-images just like the product-images are on the shop-site. How could I do that, since your theme does not support it natively?
Best Regards,
Lars Schellhas
Hello,
I’ve added the css code in your custom.css:
.category-block img {
width: 215px !important;
height: 143px !important;
}
Please check the category page now.
Best regards,
Jack Richardson.
Hello,
well, to be honest, this is not what i wanted.
The pictures should not be stretched, but cropped. – Like the pictures of products are on the shop-page.
Is there any possibility to do this?
Best Regards
Further more you have deleted my complete custom.css-file… -.-
Hello,
The pictures should not be stretched, but cropped.
Then try the following css code:
.category-block img {
object-fit: cover;
width: 150px;
height: 150px;
}
Further more you have deleted my complete custom.css-file… -.-
Your custom.css file was empty when I opened it. Please note we don’t delete anything without client confirmation.
Best regards,
Jack Richardson.
Hey,
the code works (except in MS Edge & IE, but seems like they are working on it). Thanks for that. 😉
Unfortunately (for me probably) I would like to show the category a little bit bigger than the image is, because WP loads a 143×215-thumbnail (e.g. http://www.leihes.de/wp-content/uploads/2016/02/5304-Menuegabel-Hepp-Ecco-143×215.jpg). It would be much better if it simply would load the 300×300 or 350×370 thumbnail. Do you have an idea, how to work this out?
If not, thank you anyway – you helped me a lot (didn´t knew the object-fit/object-position properties yet).
Best Regards,
Lars
P.S.: I restored the custom.css from today´s backups. Everything´s finde. 🙂
Hello,
Sorry for a long delay.
Please try to remove the code in the file wp-content/themes/idstore/code/woo.php:
remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail', 10 );
add_action( 'woocommerce_before_subcategory_title', etheme_woocommerce_subcategory_thumbnail', 10 );
in lines 503, 504. After that regenerate thumbnails and check your images.
Best regards,
Jack Richardson.
Hello,
I´m willing to wait for an answer that helps. And yours does.
In combination with the css-properties from above it´s just perfect.
Thank you very much – well done.
Best Regards,
Lars Schellhas
Hello,
You are welcome!
Best regards,
Jack Richardson.
The issue related to '‘Force cropping of category-images’' has been successfully resolved, and the topic is now closed for further responses