tools/wordpress-register-image-size-generator
WordPress Register Image Size Generator
WordPress Register Image Size Generator creates customized image sizes for WordPress, allowing you to optimize images on your website and improve performance.
snippet.php
function wp_skills_register_image_sizes() {
add_image_size( 'thumbnail', 150, 150, false );
}
// after_setup_theme is the hook the handbook requires for add_image_size():
// at the top level of functions.php it would run before the theme support it
// depends on is registered, and the size is quietly never added.
add_action( 'after_setup_theme', 'wp_skills_register_image_sizes' );
// Note: existing images are not regenerated. Only uploads made after this runs
// get the new size, unless you regenerate the older ones.