Posted By

f6design on 11/29/11


Tagged

wordpress images


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

zemonte


Enable post thumbnails for a Wordpress theme


 / Published in: PHP
 

This snippet adds support for post thumbnails (a.k.a. 'featured images') to a Wordpress theme. It also adds an additional image size for image thumbnails, hard cropped. This second step is optional.

Add this snippet to your WP theme's functions.php file.

  1. /**
  2.  * Enable post thumbnails.
  3.  */
  4. if ( function_exists( 'add_theme_support' ) ) {
  5. add_theme_support( 'post-thumbnails', array( 'project' ) ); // Add support for posts
  6. add_image_size( 'large-feature-image', 715, 402, true ); // large size, hard crop mode
  7. }

Report this snippet  

You need to login to post a comment.