Post Thumbnail, now Featured Image, is an image that is chosen as the representative image for Posts, Pages or Custom Post Types. The display of this image is up to the theme
functions.php
add_theme_support( 'post-thumbnails' );
thumbnail functions
has_post_thumbnail()
the_post_thumbnail()
the_post_thumbnail_url()
get_the_post_thumbnail()
add_image_size() set_post_thumbnail_size() get_post_thumbnail_id()
index.php / single.php / page.php
if ( has_post_thumbnail() ) {
the_post_thumbnail(); // display post thumbnail in the actual size of image
}
the_content(); // display post/page content
// without parameter -> Post Thumbnail (as set by theme using set_post_thumbnail_size()) the_post_thumbnail(); the_post_thumbnail('thumbnail'); // Thumbnail (default 150px x 150px max) the_post_thumbnail('medium'); // Medium resolution (default 300px x 300px max) the_post_thumbnail('medium_large'); // Medium Large resolution (default 768px x 0px max) the_post_thumbnail('large'); // Large resolution (default 1024px x 1024px max) the_post_thumbnail('full'); // Original image resolution (unmodified) the_post_thumbnail( array(100,100) ); // Other resolutions