Software Dev

Viral WordPress Theme Homepage Image Size Problem

Viral WordPress Theme Homepage Image Size Problem

Software Dev
After finally working out how to add a featured image to the homepage for posts I ran into a problem where the images were appearing as full sized. This meant over 10Mb of image files were being downloaded when the homepage was loaded. There may be a way to select a lower resolution file but I couldnt find it, if there is let me know in the comments! Wordpress has a specific function that loads a thumbnail based on a given size. After digging through the files for the Viral theme I narrowed the post code for the homepage down to /wp-content/themes/viral/template-parts/content.php Glancing at this I could see that line 17 $viral_image = wp_get_attachment_image_src( get_post_thumbnail_id() , 'viral-blog-header' ); This gets the full size image of the file. Instead of this usin...