[Resolved] Featured Images

Home Forums Support [Resolved] Featured Images

Home Forums Support Featured Images

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

    Hi.

    When I analyze my homepage, for example, at Google PageSpeed Insights and GTmetrix, my images seem to slowing down my site.

    And I think it is mainly because of how the theme is handling feature images.

    When I download the optimized images, the dimensions are these images are 365×243. And it seems like if I upload them to my server, it will overwrite the 900×600 original images.

    I’ve read this: https://docs.generatepress.com/article/adjusting-the-featured-images/.

    But when I changed the dimensions for the featured image on the archive page at Layout > Blog, it made the image super tiny, which is not the look I”m going for.

    How do I make Google and GTmetrix happy? And maintain the design I want?

    Cheers!

    #556188
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The theme is using the standard WP way to show featured images, which actually uses srcset to show images closest to the size of the content area.

    Perhaps you just need to optimize your images before you upload them? There’s lots of plugins to do this, but I usually just use a tool like http://optimizilla.com/.

    Let me know πŸ™‚

    #556367
    Janine

    Hi, Tom.

    Thanks!

    I do optimize my images before I upload.

    FIRST, I resize them to 900×600 in Canva.

    SECOND, I optimize them at optimizilla.com.

    And still GTmetrix and PageSpeed want to optimize the featured images further to 365×243.

    Thank you!

    #556586
    Tom
    Lead Developer
    Lead Developer

    Ah, it doesn’t like that you have large images (900px wide) inside the columns.

    Perhaps try a function like this:

    add_filter( 'generate_page_header_default_size', 'tu_smaller_column_images' );
    function tu_smaller_column_images( $size ) {
        // Set up our conditional
        if ( ! is_singular() && ! in_array( 'featured-column', get_post_class() ) ) {
            return 'medium';
        }
    
        return $size;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know πŸ™‚

    #556680
    Janine

    Thanks, Tom.

    I will try the function.

    I determined that my feature image width was 750 for posts and 800 for pages. And content is 670 for posts and 720 for pages.

    So I decided to make all images 900px wide.

    BUT going forward should I reduce the width of my images?

    Thank you!

    #556707
    Janine

    Tom,

    I tried your function and it seems to have worked! Thank you so much! 😁

    #556899
    Tom
    Lead Developer
    Lead Developer

    You’re very welcome! πŸ™‚

    #557139
    Janine

    Hi, Tom.

    Going forward should I reduce the width of my images? Thank you!

    #557317
    Tom
    Lead Developer
    Lead Developer

    Your images should be big enough for your featured post at the top.

    From now on, the posts within the columns will use the “medium” image size, which you can see configured in “Settings > Media”.

    #557329
    Janine

    Thanks, Tom. Got it!

    #557461
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad i could help πŸ™‚

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.