How to modify wordpress thumbnail image size

How to modify wordpress thumbnail image size

Written by  Face4store

If you enable post thumbnails for your theme, you will find that you may not like the default size.

If you want all of your post thumbnail images to be the same size throughout your theme, then you can set it in functions.php:

set_post_thumbnail_size( 100, 100 ); // 100 pixels wide by 100 pixels tall, box resize mode

OR:

set_post_thumbnail_size( 100, 100, true ); // 100 pixels wide by 100 pixels tall, hard crop mode

However, if you want to have different image sizes for archives, custom category pages, posts, and custom post types, you can set them directly within the template tag, like so:

<?php the_post_thumbnail('thumbnail'); ?>

You can select from the following options:

the_post_thumbnail(); // without parameter -> Thumbnail

the_post_thumbnail('thumbnail'); // Thumbnail

the_post_thumbnail('medium'); // Medium resolution

the_post_thumbnail('large'); // Large resolution

the_post_thumbnail( array(100,100) ); // Other resolutions

From Sarah Gooding

Related items

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.