search ]

Add Custom Image Sizes

You can define custom image sizes for your site. Images are generated on upload or when regenerating thumbnails. Add to your functions.php file. For more on image optimization.

add_action( 'after_setup_theme', function() {
	add_image_size( 'card-thumbnail', 400, 300, true );
	add_image_size( 'hero-banner', 1920, 600, true );
} );

Replace names and dimensions as needed. Use true for crop or false for scale.

Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo