get_the_post_thumbnail_url with an unregistered size

The official code reference for get_the_post_thumbnail_url states: $size (string|array) (Optional) Registered image size to retrieve the source for or a flat array of height and width dimensions. (emphasis mine). I’m using the following parameters: $img_url = get_the_post_thumbnail_url(get_the_ID(), array(‘300’ , ‘170’)); But it doesn’t return the size I want. The registered image sizes are 150 x … Read more

How to resize images in wordpress without adding any compression or changing the color profile of the images, possible?

As you can guess from the title, Im looking for a solution that allows me to alter the way WordPress processes/saves its newly created images according to the media settings in the dashboard. This is very important since I primarily use WordPress as a way to present portfolio images so they need to maintain the … Read more

How to delete resized (cropped) image uploads and prevent future resizing?

I want to delete all the resized images while leaving the original image. I have more than 20 GB of unused data taking up room on the server. For example: first-image-name.jpg first-image-name-72×72.jpg first-image-name-150×150.jpg first-image-name-250×250.jpg first-image-name-300×300.jpg first-image-name-400×400.jpg first-image-name-1024×1024.jpg second-image-name.jpg second-image-name-72×72.jpg second-image-name-150×150.jpg second-image-name-250×250.jpg second-image-name-300×300.jpg second-image-name-400×400.jpg second-image-name-1024×1024.jpg Is there a way to delete all the resized images and … Read more

Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions

Normally when you set a custom image size using hard crop – e.g. add_image_size( ‘custom-size’, 400, 400, true ); – you get the following results: #1 Uploaded image: 600×500 > Thumbnail: 400×400. #2 Uploaded image: 500×300 > Thumbnail: 400×300. #3 Uploaded image: 300×200 > Thumbnail: 300×200. However what I’d like to do is when the … Read more