Top

Daily Tip: How to Change the Post Thumbnail Size in a WordPress Theme

August 2, 2010

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

For more information on post thumbnails, check out the WordPress codex or Mark Jaquith’s in-depth tutorial on how to use them.

Tweet This Post

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.