/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_theme_support( 'post-thumbnails' ); or add_theme_support( 'post-thumbnails', array( 'post' ) ); // Add it for posts add_theme_support( 'post-thumbnails', array( 'page' ) ); // Add it for pages set_post_thumbnail_size( 50, 50 ); // 50 pixels wide by 50 pixels tall, box resize mode <?php if ( has_post_thumbnail() ) { // the current post has a thumbnail } else { // the current post lacks a thumbnail } ?> <?php the_post_thumbnail(); ?>
URL: http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/
Comments
