2
I’m in trouble and I don’t know how to fix it I’ve tried everything and nothing!
I have a theme that uses 3 different images for the highlighted image, I’m using the add_image_size
to generate these three image sizes, plus the problem is that the entire image I upload generates 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 him to generate only 3 images of the featured image.
You could do that?
follow my functions code 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;