Archived topic
latest updates problems with image size
10 replies · Started by Marco on April 1, 2020
Hello
just updated theme and plugin to the latest version and I'm running into an issue with some generated inline style - I'm showing some the posts in a 3-columns grid incl. the featured image which is out of proportions now - I checked the css and it says: .resize-featured-image .post-image omg {width: 800px; height: 600px; } - if I uncheck the height setting in Safari the layout looks o.k. - any idea what's going on and where to fix this?
Thanks
Hi there,
can you provide a link to your site.
You can edit your original topic to share the link privately by adding it to the Site URL field.
it is a local installation - I've not update the live site yet
adding the following css to my stylesheet fixes the issue.
.resize-featured-image .post-image { // added 04/01/2020 after update of GP theme and plugin
img {
height: auto;
}
}
Hi there,
In Customize > Layout > Blog, do you have width and height options set?
If you want the height to be auto, why not remove the height value?
width and height are not set - fields are empty
Strange, that CSS shouldn't exist if those options are empty.
Do you have any custom functions added to the site?
I have to look into that, I'm not sure.
looking at the html I see this:
<style id='generate-style-inline-css' type='text/css'>
.resize-featured-image .post-image img {
width: 800px;
height: 600px;
}
........
any idea where that's coming from?
That CSS is coming from the Blog module. The 800 and 600 values can come from one of two places:
1. The width/height options in Customize > Layout > Blog
2. Using generate_blog_image_attributes filter in a custom function
yep, was the filter function like:
if ( is_front_page () ) {
$atts[ 'width' ] = 800;
//$atts[ 'height' ] = 600;
$atts[ 'crop' ] = false;
}
commenting the height value seems to do the trick - the css fix isn't needed anymore. you must have changed something as before the updates the out of proportion of the images was not an issue?!
Thanks for your help Tom
I think it's because the new system actually works better. You had the width and height set, but crop was set to false, which is why it looked out of proportion.
Glad it's working now :)
I either have to take the height out of the filter function or use my css fix - setting the crop to true still leads to a weird result as the pictures are 600px high also since I'm using some column layout maybe just 300px wide - I've actually also set the img parent container to overflow: hidden but it is ignored?