Picture sizes of Recent Posts

Hi,

this is an updated support question to this ticket.

I just installed X and a new Wordpress Version on XAMPP. So everything is brand new and there is no other plugin in use. My last question was about the different picture sizes I can found in my upload folder. You wrote that X only adds 4 custom sizes.

When I now upload a picture to a post I got 7 different picture sizes. Please see the screenshot. So they all must come from X.

Is it really necessary for X to have 6 other image sizes? Is this something I can reduce?

I also added the code from this topic to my functions.php in my X Child.

But the recent post function is still using the wrong picture size of 1110x620 and croped it to 447x251. The original size of the picture is 1200x800.

The recent post function should use the medium size from my images of 400x267. Is there anything I need to change on that code?

Please remind - I work on localhost, so I can´t give you access to the files. But I made a screenshot of the debugger code :wink:

Michael

Hey Michael,

It looks like you’re using other optimization tools and that is affecting the image size. Please deactivate all optimization plugins and optimization services such as CDN and test again.

Regarding the image sizes, our themes only does have 4 to 5 image sizes, the rest comes from third-party plugin. Please deactivate all your third-party plugins and remove all customizations and check what image sizes are left.

Thanks.

Hi,

as already mentioned above, this is a completely new Wordpress installation without any third-party plugin. Only X, Cornerstone and the Classic Editor is installed. Therefore the 7 imags size can only come from X or maybe Cornerstone?

…other optimization tools and that is affecting the image size

No, no third-party plugins. No CDN. No Cache.

So how can I set the right image size for my recent posts on my mainpage?
This is the shortcode I use: [recent_posts count=“3”]

Hi Michael,

You may add the following code on your child theme functions.php to see where those other image size is coming:

add_action('init', 'get_all_image_sizes');

function get_all_image_sizes(){
    global $_wp_additional_image_sizes; 
    print '<pre>'; 
    print_r( $_wp_additional_image_sizes ); 
    print '</pre>';
}

For more discussion about image size and how to remove certain size, please check this thread.

By default recent post shortcode uses entry-cropped version of the featured image. To change it, please check this thread as guide.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.