I have a problem and I do not know how to solve it I tried everything and nothing!
I have a theme that uses 3 different images for the highlighted image, I'm using add_image_size
to generate these three image sizes, but the problem is that the entire image I upload causes the 3 sizes!
If I post a gallery, 3 different image sizes will be generated for each image and this is consuming my server too much. I need it to generate only 3 images of the featured image.
Would you be able to do this?
follow my code of functions with add image size:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support('post-thumbnails');
add_image_size('ultimas-capa', 370, 240, true);
add_image_size('capa-interno', 1020, 300, true);
add_image_size('blog-capa', 780, 300, true);
}
if ( ! isset( $content_width ) ){
$content_width = 800;
}
add_filter('image_size_names_choose', 'curioso_image_sizes');
function curioso_image_sizes($sizes) {
$mythemesizes = array(
'blog-capa' => __('Imagem Postagem')
);
$sizes = array_merge($sizes, $mythemesizes);
return $sizes;