How to add additional WordPress image sizes

You can add as many individual image sizes to your WordPress site as you like by using the following function.

Instructions
Add the following code to your functions.php file of the theme you wish to use the custom image sizes for.

Your custom image sizes won’t show up in your media settings, or your post edit screen, but it will be usable when calling a post thumbnail via PHP, like so:

Related Links:
http://codex.wordpress.org/Function_Reference/add_image_size
http://codex.wordpress.org/Post_Thumbnails
http://codex.wordpress.org/Function_Reference/add_theme_support

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Siteground Web Hosting

Snippet Info

Tested with Wordpress v. 4.9.5
Last Modified: 15.05.2018
Last Reviewed: 15.05.2018

How to add additional WordPress image sizes
5 (100%) 5 votes
Please report broken snippets.
Report Broken Snippet
WP Engine