G
G
Genri_Rus2020-01-23 18:54:23
WordPress
Genri_Rus, 2020-01-23 18:54:23

Is it possible to crop the thumbnail at all depending on the category?

As it turned out, the new size of the picture (thumbnail) is registered only once and only here:

function woocommerce_setup() {
  add_image_size( 'own_thumbnail_all', 70, 55 );
}
add_action( 'after_setup_theme', 'woocommerce_setup' );

Otherwise, elsewhere (outside of after_setup_theme) the new thumbnail size won't be applied at all.
Question, am I not able to crop depending on the category ?
Will I have to register 2 different thumbnails?
Type:
add_image_size( 'own_thumbnail_all', 70, 55, true );
add_image_size( 'own_thumbnail', 70, 55, false );

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WP Panda, 2020-01-24
@wppanda5

You can generally disable the generation of thumbnails, and sprinkle on the fly in the right place, for example, using this https://github.com/bfintal/bfi_thumb

L
lamer350, 2020-01-23
@lamer350

The thumbnails are created when the image is uploaded to the server, not when the category is created. This is in no way related to each other. Yes, just register a new size.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question