- This topic has 10 replies, 2 voices, and was last updated 5 years, 7 months ago by
Tom.
-
AuthorPosts
-
April 20, 2018 at 2:44 pm #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!
April 20, 2018 at 8:55 pm #556188Tom
Lead DeveloperLead DeveloperHi 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 π
April 21, 2018 at 4:26 am #556367Janine
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!
April 21, 2018 at 9:12 am #556586Tom
Lead DeveloperLead DeveloperAh, 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 π
April 21, 2018 at 11:37 am #556680Janine
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!
April 21, 2018 at 12:02 pm #556707Janine
Tom,
I tried your function and it seems to have worked! Thank you so much! π
April 21, 2018 at 8:41 pm #556899Tom
Lead DeveloperLead DeveloperYou’re very welcome! π
April 22, 2018 at 5:27 am #557139Janine
Hi, Tom.
Going forward should I reduce the width of my images? Thank you!
April 22, 2018 at 9:48 am #557317Tom
Lead DeveloperLead DeveloperYour 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”.
April 22, 2018 at 10:09 am #557329Janine
Thanks, Tom. Got it!
April 22, 2018 at 2:48 pm #557461Tom
Lead DeveloperLead DeveloperAwesome, glad i could help π
-
AuthorPosts
- You must be logged in to reply to this topic.