Build Your Own Business Website header image

Everything You Wanted to Know about the WordPress Media Library – Part 3 – Creating Custom Image Sizes in WordPress

Difficulty Level -

Filed Under Topics - , ,

Listed Under Lesson Subjects -

Applies to -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

Now that you understand WordPress I 3.9mage Sizes, the next thing we’re going to do is to create a custom image size and then I’ll show you ways to use it.

Use the Simple Image Sizes Plugin

First, we’ll go to our Plugins and Add New. The plugin we’re adding is called Simple Image Sizes. So search the plugins and it’s this one right here. We’re going to install it and activate it. Now inside of the media settings I have a dialog.

It’s showing me all of the registered image sizes not just thumbnail, medium and large. It shows the featured slide size and featured slide thumb size both of which were created by Meteor Slideshow as well. And from here we can create a new image size which is what we’re going to do next.

Create Custom Sizes

We’re going to create a thing I’m going to call full-thin and this is going to be for image sizes that are 564 pixels wide but that that are only 250 pixels tall. I’m going to call it “Full Width Thin”. Yes, we’re going to crop and yes, I’m going to show it in post insertion. Let’s validate this and so now we have a new image size.

I’m going to create one more and I’m going to call it tiny-thumbnail. This is going to be75x75 and I’ll call it “Tiny Thumbnail”. Note that when you’re sizing these things, you can’t use any spaces here so it’s just tiny-thumbnail. Yes, we’re going to crop again but no, we’re not going to show it in the post insertion. Let’s validate this one as well.

Regenerate Sizing

Now that I’ve done that, this plugin actually provides for regeneration also. I don’t need to regenerate everything because I’ve already got thumbnail, medium, large, featured-slide and featured-slide-thumb. The only two I don’t have are the full-thin and the tiny-thumbnail.

It asks you which post type you want to do this for and we’re not going to do it for slides but we’ll do it for all other post types and regenerate thumbnails.

Richard asks, “Is there a regenerate images and optimize all at the same time?”. Not that I know of, no.

Limitations on Regeneration

Okay, it was only one image. All the rest of the images were not attached to posts or pages so they didn’t get regenerated. So the limitation of this is that it only regenerates thumbnail images for images that are actually attached to post, pages or custom post types.

It does not do them for images that are not attached which I didn’t expect so that may be a reason to use Regenerate Thumbnails plugin instead.

Let’s come back over here to edit this page and we’re going to change this image and have no caption. Instead of large we’re going to take Full Width Thin and hit update. Now if we view the page we’ve got this cropped down image that’s showing up.

0 Comments… add one
0 comments… add one

Leave a Comment