0

I made my theme. And in my theme, there is 4 image-sizes setting in my functions.php like bellow.

add_image_size( 'small_img', 200, 120, true );
add_image_size( 'large_img', 500, 20, true );
add_image_size( 'very_large_img', 900, 350, true );
add_image_size( 'special', 700, 150, true );  

So, there'll be saved 4 sizes of the image when I upload a image with wp-uploader except full-size.

I set to enable to upload an image in frontend-page( page-id = 2 ).

I want that only 'special(700*150)' image-size can be saved when I upload an image at this page(page-id = 2).

so I set in functions.php like bellow.

if( is_page( 2 ) ){
   add_image_size( 'special', 700, 150, true );
} 

but it doesn't work.

Is there a way to save just one image-size that I want at specific page?

Please give me some help. Thank you.

  • No, you can't do this. – Mat Apr 25 '18 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.