air-light icon indicating copy to clipboard operation
air-light copied to clipboard

Image_sizes in functions doesn't do anything

Open filipchrapek opened this issue 2 years ago • 3 comments

I’ve added some custom image sizes to functions.php. But that’s not enough to get it to work, right? I’ve checked /inc/includes/theme-setup.php and it seems that there is no function responsible for implementing custom image sizes.

Is that correct or am I doing it wrong?

filipchrapek avatar Jan 22 '22 13:01 filipchrapek

Hello Filip. Air-light has no wrapper function for registering image sizes but you can register them by using WordPress functions. When adding hooks or functions to the theme, please remember to use namespaces.

This is really not a theme issue, please refer to official developer docs by WordPress about registering image sizes.

ronilaukkarinen avatar Jan 25 '22 09:01 ronilaukkarinen

Hello Roni,

Sure, I just think it's a bit confusing to have a place for custom image sizes, since the changes don't affect anything.

I've added function that loops over custom sizes and updates the default ones. Do you think it would be useful for Air-light?

filipchrapek avatar Jan 25 '22 10:01 filipchrapek

Oh, you mean this bit:

https://github.com/digitoimistodude/air-light/blob/fabc4e93e69ce017a5eb22d096d50cb18abe30e0/functions.php#L35-L42

This may need checking up. We actually prefer to use always WordPress built-in image sizes, otherwise we'll get too much bloat in our media libraries. The use case for custom image sizes is so rare (about 1 of 100 projects) that we do not recommend to have them enabled by default.

@timiwahalahti when you have time, could you check out if we still need it / is it functioning properly. Reopening and reassigning this issue.

ronilaukkarinen avatar Jan 25 '22 11:01 ronilaukkarinen