WP add_image_size绑定到不同的帖子类型

I have maked site on WP. There are two slider-bars and some sections with img. Resolutions of this img are different.

I want ( need ) to use add_image_size function to crop image for my tasks, but how I can bind func. add_image_size with imgs for one of the sections / slide-bars? I don't understand, how i must declare that thumbnail for post (for ex.) must be cropped by add_image_size. Sorry, may be for this is stupid question

Usually you will declare a new image size in your functions.php, something like:

add_image_size( '1280-thumb', 1280 );//1280px wide, free high

and then call that image size wherever you need it. So what you need to do is create as many image sizes as you need and then call each specific size in each sidebar or anywhere else on your site where those images might be needed. You could limit when these thumbnails are created based on the post type they are uploaded to for example with something like this:

if( get_post_type() == ‘your_post_type’ ) {
    add_image_size( '1280-thumb', 1280 );//1280px wide, free high
}

This will only create the ‘1280-thumb’ for images uploaded directly to posts belonging to a custom post type named ‘your_custom_post_type’.