[Support request] latest updates problems with image size

Home Forums Support latest updates problems with image size

This topic contains 10 replies, has 3 voices, and was last updated by  Marco 1 month, 3 weeks ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1221966

    Marco

    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

    #1222084

    David Customer Support

    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.

    #1222557

    Marco

    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;
    		}
    	}
    #1222578

    Tom Lead Developer

    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?

    #1222581

    Marco

    width and height are not set – fields are empty

    #1222583

    Tom Lead Developer

    Strange, that CSS shouldn’t exist if those options are empty.

    Do you have any custom functions added to the site?

    #1222593

    Marco

    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?

    #1222629

    Tom Lead Developer

    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

    #1222696

    Marco

    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

    #1222703

    Tom Lead Developer

    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 🙂

    #1222736

    Marco

    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?

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.