You would need to modify a core WordPress file (not advisable) – media.php located in wp-includes
Just do it like this: http://wordpress.tv/2009/01/05/changing-your-default-media-settings/
yea.. i just think about it lately but is there any way tooverride without playing the wordpress core.. ’cause i hope my theme can be installed on all wordpress version and all website wordpress-based platform..
thanks vjpo.. but is that code register new image size? or it can do override the default image size such as thumbnail, small, medium and large?
Yes, this function registers new image sizes. To override default sizes you can use in functions.php something like
add_theme_support('post-thumbnails');
update_option('thumbnail_size_w', 150);
update_option('thumbnail_size_h', 150);
update_option('large_size_w', 500);
You can easily find additional info and examples about this functions.
Check also set_post_thumbnail_size and similar topic
And to disable creating default image sizes you can set their H and W to 0 (Settings->Media)
thanks vjpo.. can’t wait to try it..
um.. one more thing, it’s right if i want to set the height of image to auto ( to keep the ratio ) just set to 0 or don’t set it at all?
add_image_size( 'my-thumb', 300, 9999 ); and add_image_size( 'my-thumb', 300); do the same – height is auto.
looks the same with update_option('thumbnail_size_h', 0); if height wasn’t overridden – there is a risk to get old thumb H
thanks a lot vjpo.. :thumbsup: