@cagatay Belgen Yes I know that is not ideal, maybe a function in functions.php it would be better.
Sorry I’m not a coder but I have modified those “callings” in home.php in that way and it works well, so I have shared my fix for OP @cyrilb245, or anyone interested in.
Anyway, sizes are different for some categories maybe, not for every image. So you can have some categories in home page (the “problem” is only in home page, not for sidebar and widget), but I don’t think that you have more than 4-5 categories (do you have?) – beyond the fact that all categories can have featured image of the same size, it’s even better aesthetically.
Also, the missing size is only for the first image of the category, the bigger one, not for the other three images in the category.
A sample of what I have done:
<?php if ( in_category (123) || in_category (45) ) { ?>
<img src="<?php echo leaf_get_post_image( null,null,true,null, 'large' ); ?>" width="300" height="120" alt="<?php the_title(); ?>" class="attachment-post-thumbnail wp-post-image">
<?php } elseif ( in_category (67) ) { ?>
<img src="<?php echo leaf_get_post_image( null,null,true,null, 'medium' ); ?>" width="217" height="200" alt="<?php the_title(); ?>" class="attachment-post-thumbnail wp-post-image">
<?php } elseif ( in_category (89) || in_category (101) ) { ?>
<img src="<?php echo leaf_get_post_image( null,null,true,null, 'medium' ); ?>" width="200" height="300" alt="<?php the_title(); ?>" class="attachment-post-thumbnail wp-post-image">
<?php } ?>
I don’t know if there’s a better way to write it.