Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have several custom media sizes we always use.

vertical: 95x117, 130x160 horizontal: 440x304, 220x152 home: 260x160

Is there anyway to set the thumbnail, medium and large to vertical parameters and horizontal ones? Or is it better to leave the defaults (150x150, 300, 1024) so that I can set the sizes using width and height parameters as needed?

Thanks! Donna

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

I would not alter the core intermediate image sizes. If you have custom image sizes, register them using add_image_size(). e.g.

function mytheme_add_custom_image_sizes() {
     // Add "vertical" image
    add_image_size( 'vertical-a', 95, 117, true );
    add_image_size( 'vertical-b', 130, 160, true );
    // Add "horizontal" image
    add_image_size( 'horizontal-a', 440, 304, true );
    add_image_size( 'horizontal-b', 220, 152, true );
    // Add "home" image
    add_image_size( 'home', 260, 160, true )
}
add_action( 'after_setup_theme', 'mytheme_add_custom_image_sizes' );

Now, your registered custom image sizes can be used in any of the core image-related functions, to return the image in one of your custom sizes.

share|improve this answer
    
Thanks so much! –  Donna Mar 20 '12 at 12:58
    
You're welcome! Does "thanks so much!" mean that this solution worked for you? If so, please accept it, by clicking the checkmark beneath the vote count. If this solution didn't work for you, please comment to explain why, so that we can find a working solution. –  Chip Bennett Mar 20 '12 at 13:04
add comment

Some media size names are reserved eg thumbnail, medium and large. but it may be possible to customise their sizes from admin screen. and besides if you really want to use your custom sizes, you could always edit your theme to use your custom sizes instead of wordpress sizes

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.