Change theme featured images and thumbnail sizes

I tried to replace the x theme custom image sizes in setup.php. My new sizes and names show up when regenerating image files but the x theme custom image sizes are still being generated as well.

How do I remove the x theme custom image sizes (entry, entry-cropped, etc.) or prevent them from being generated?

Hi there,

Would you please kindly explain what you want to achieve? Maybe we can give you a better alternative regarding images sizes.

Kindly get back to us with detailed information about the problem you are experiencing which made you decide to change the image sizes, then we will check and try to give a suggestion.

Meanwhile, there is a good article regarding X Images which you can check:
https://xthemetips.com/size-matters-the-x-image-guide/730/

And at last get back to us with the URL/User/Pass of your Wordpress Dashboard using the Secure Note feature of the post so that we can check the dashboard if it is needed.

Thank you.

I’m trying to achieve a fast page load times and I need to keep the number of files on my server low due to my host’s requirements. Right now X loads huge size photos on my homepage creating a long load time and adds sizes I’ll never use on my server.

On my homepage I am using the recent posts shortcode to add info and want to use image sizes that are close to the size of the images in the layout. (I already have modified recent posts shortcode to select image name size).

I also want to choose and set a specific size for the images loading on my archive pages.

I am using an edge to edge featured image on my page/posts pages which I use the WP large image size instead of ‘entry’ or ‘entry-cropped’ so I want to not have the size generate those sizes as they are not needed or used.

I’ve been able to successfully add my own custom image sizes and names via functions.php. I’ve tried various methods to remove X’s default image names and sizes but nothing is working.

How do I remove all of the default image names and sizes (entry, entry-cropped, etc.) set by X?

Ok, after some testing I found that adding this code in my child theme’s functions.php will remove the sizes I do not want/need on my site:

function child_theme_setup() {
add_image_size( ‘entry-fullwidth’, 0 );
add_image_size( ‘entry-cropped-fullwidth’, 0 );
add_image_size( ‘entry’, 0 );
add_image_size( ‘entry-cropped’, 0 );
}
add_action( ‘after_setup_theme’, ‘child_theme_setup’, 11 );

This seems like a weird way to do that, but it is the only thing I have found to work.

Hello There,

Thanks for updating in! It’s good to know that you have figured out a way to resolve this issue.
For more added information, you can check out the codex:


https://codex.wordpress.org/Function_Reference/remove_image_size

Cheers.

Yes, I tried remove_image_size first but it does not work.

I see, Thanks for sharing. Adding the same size will just overwrite the previous sizes registered by X theme. That should work :slight_smile:

Thanks!