Tagged: blogs
The Featured images of blog post on my website are getting cropped. I want them to be visible as in whole without getting cropped and the text below them . Attaching the link of the page below –
Hi sarthakchoudhary,
The image sizes used is 705 x 705px, so unless it’s a square image, some parts of the image would be lost, otherwise, the layout will break.
You can change the size by adding this PHP snippet in your child theme’s functions.php file (or use plugin like WPCode to add PHP snippet):
function enfold_customization_modify_thumb_size( $size ) {
$size['masonry'] = array( 'width' => 705, 'height' => 705 , 'crop' => false );
return $size;
}
add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
Just adjust the values as you see fit.
Hope it helps.
Best regards,
Nikko
I tried this by changing the values but there was no change. I also changes the dimension of my images to 705 x 705 but still they were getting cut
Hi sarthakchoudhary,
You will need to regenerate the images or re-upload it so the filter will run.
Best regards,
Nikko
Yes I regenerated the images and re uploaded them.But still there is no change
Hi,
Right now your image looks like this:
if you try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:
#top .av-masonry-image-container {
background-position: unset;
background-size: contain;
background-repeat: no-repeat;
}
it should look like this:
but you will need to make sure all of your images are square, unlike this one:
Best regards,
Mike
Thank you so much mike for helping out