Code in my funcitons.php
function custom_thumbs() {
add_image_size( 'cover-size', 1600, 450, true );
}
add_action( 'after_setup_theme', 'custom_thumbs' );
Usage:
echo the_post_thumbnail($post->ID,'cover-size');
but this is the result:
<img width="3648" height="2736" src="http://localhost/sonru/wp-content/uploads/2015/12/DSC04656.jpg" class="attachment-9 size-9 wp-post-image" alt="DSC04656" cover-size="" srcset="http://localhost/sonru/wp-content/uploads/2015/12/DSC04656-300x225.jpg 300w, http://localhost/sonru/wp-content/uploads/2015/12/DSC04656-600x450.jpg 600w" sizes="(max-width: 3648px) 100vw, 3648px">
What Am I missing here?
-Edit-
I'm already regenerating thumbnails using the regenerate thunbnails
plugin
add_image_size
suggests there would be an unlimited height which is not the case as you've specified a max-height of 450 ( and anything else to be cropped ). If you truly want to replicate an "unlimited height" you would need to put in a extremely large number such as999999