Sometimes you’d like to change the default thumbnail (or Medium/Large) images dimensions when the user is switching to your WordPress theme. The default setting for a thumbnail is 150x150 pixels.

If you want the thumbnail dimensions automatically updated once the user activates your theme, paste this code to your functions.php file:

/**
 * Set some things when the theme is activated
 */
if ( ! function_exists( 'your_theme_activated' ) ) {
    function your_theme_activated() {
        // set thumbnail size in settings > media
        update_option( 'thumbnail_size_w', 100 );
        update_option( 'thumbnail_size_h', 75 );
    }
    add_action( 'after_switch_theme', 'your_theme_activated' );
}

Happy WordPressing! 🙂

Take a Look at Our WordPress Themes

Choose from a wide range of beautiful niche designs that you can try for free.

View All WordPress Themes
About the Author
Since I built my first website in primary school I've had a strong passion for web development. When not visiting conferences, giving talks or organizing local development related events, I focus on fast and highly optimized online solutions. I'm a windsurfer, snowboarder and beer lover in my leisure time.