What Wordpress image distortion am I looking for?

I know that my question will be a little vague, but I need a direction so that I can better understand things. I have been working with wordpress for a long time.

I want to add new image output sizes for the uploaded image. I found the add_image_size () function and the set_post_thumbnail_size () function.

Which function will resize the srcset image for me? Which function resizes default downloads and how can I add parameters to my download sizes?my created srcset image my available options

+4
source share
1 answer

add_image_size () is best suited for your needs.

https://developer.wordpress.org/reference/functions/add_image_size/

Update: functions.php

add_filter( 'image_size_names_choose', 'my_custom_sizes' );

function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
       'custom-size' => __('Your Custom Size Name'),
    ) );
 }

. , .

global $_wp_additional_image_sizes;

, !

+1

Source: https://habr.com/ru/post/1621972/


All Articles