
Untitled
By: a guest on
May 4th, 2012 | syntax:
None | size: 0.90 KB | hits: 10 | expires: Never
Overriding parent function in WordPress
// Set image sizes upon theme activation
if(! function_exists( 'theme_image_setup' )):
function theme_image_setup() {
// updating thumbnail and image sizes
update_option('thumbnail_size_w', 200);
update_option('thumbnail_size_h', 150);
update_option('medium_size_w', 620);
update_option('medium_size_h', '');
update_option('large_size_w', 940);
update_option('large_size_h', '');
}
endif;
add_action( 'switch_theme', 'theme_image_setup' );
function theme_image_setup() {
// updating thumbnail and image sizes
update_option( 'thumbnail_size_w', 150, true );
update_option( 'thumbnail_size_h', 150, true );
update_option( 'medium_size_w', 620, true );
update_option( 'medium_size_h', '', true );
update_option( 'large_size_w', '', true );
update_option( 'large_size_h', 500, true );
}