Tagged: featured image
At the moment the piece of the featured image that is displayed is centred, this often results in photos of people with the heads cut off, if I make the height unlimited you end up with stupidly tall images. So how can I shift the position of the image that is displayed to be from the top of the image, or even better is there an option where it could be changed per post so that it could be determined depending on the image?
Also there tends to be a lot of smaller images uploaded as the featured image, I would like to stretch these so they cover the entire width of the single post.
Cheers
Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
function enfold_customization_modify_thumb_size( $size ) {
$size['entry_with_sidebar'] = array('width' => 845, 'height' => 321, 'crop' => array('center', 'top') );
$size['entry_without_sidebar'] = array('width' => 845, 'height' => 321, 'crop' => array('center', 'top') );
return $size;
}
That will ensure that WordPress crops the image from the top, to get this working on your already uploaded images you’d need to regenerate them using a plugin like this.
Cheers!
Josue