Hexodus
8/2/2017 - 9:17 AM

Add custom images sizes to Wordpress and Admin area. Found solution here: https://havecamerawilltravel.com/photographer/wordpress-resize-th

Add custom images sizes to Wordpress and Admin area. Found solution here: https://havecamerawilltravel.com/photographer/wordpress-resize-thumbnails

Place this code in your functions.php (i.e. in your child theme's folder)

<?php
	add_image_size( 'homepage-thumb', 270, 175, false ); //soft crop = resize
	add_image_size( 'search-thumb', 150, 150, true ); //hard crop

	add_filter( 'image_size_names_choose', 'my_custom_sizes' );
	function my_custom_sizes( $sizes ) {
		return array_merge( $sizes, array(
		'homepage-thumb' 	=> __( 'Homepage Thumb' ),
		'search-thumb' 		=> __( 'Search Thumb' ),
		) );
	}
?>