How to Change the Post Thumbnail Size in a WordPress Theme
If you have enabled post thumbnails for your theme, you might provide overly you may not such as the default size. If you look for all of your post thumbnail photos to be the same size through your theme, when that happens 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
Anyhow, 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:
1 |
<?php the_post_thumbnail('thumbnail'); ?> |
You can select from the following options:
1 2 3 4 5 6 7 |
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 |
For more information on post thumbnails, check out the WordPress codex or Mark Jaquith’s in-depth tutorial on how to use them.