Hi mbeckelhimer,
we’ll make it perfect for your site! ??
When you upload an image, WordPress creates some copies of it in different sizes. These sizes are predefined. But you can add all the sizes you need. Only consider that the more sizes you add, the slower will be the process of uploading an image, because WordPress must create more sizes of a single image.
When you create a new custom image size, this will be available and ready to use in the dropdown of Posts in Sidebar.
Adding custom sizes requires to modify the functions.php
of your current theme. You can do it using the tool already available in your WordPress Dashboard, or you can use an FTP client to download in your computer that file, edit it and upload it back to the server. Choose the method you like.
Step 1
Definition of two new custom sizes
Go to your WordPress Dashboard > Appearance > Editor.
On the right, click on Theme Functions (functions.php).
Add these lines at the end of it:
function my_custom_images_size() {
add_image_size( 'my-525x100-image', 525, 100, true );
add_image_size( 'my-400x200-image', 400, 150, true );
}
add_action( 'after_setup_theme', 'my_custom_images_size' );
525
and 100
are the width and the height of the new size respectively: edit these values according to your needs. The same thing is for 400
and 150
.
Look carefully if there’s a ?>
sign at the end of this file: if it’s present, add those lines before the ?>
!
Save the file.
Step 2
Using the new image sizes
Go to Dashboard > Appearance > Widgets.
Modify the widgets that are using Posts in Sidebar and assign the new image sizes accordingly.
Step 3
Uploading the images to let WordPress create the new sizes
Open the post which needs the new size and upload an image. This image will be processed by WordPress and will have two new sizes (besides the old sizes). Choose it as Featured image.
Save the post.
Now you should see that for this post the new sizes are used.
Repeat this step 3 for other posts.
Final note
If you have a lot of images to process, you can use a plugin that automates the processing. For example, Regenerate Thumbnails is a plugin that creates the new sizes you just added to your functions.php
. This plugin can regenerate all the new sizes at once or you can choose which files are to be processed. More info are available in the plugin’s page.
Hope this helps.
Let me know if you have any other questions.