Skip to content

Instantly share code, notes, and snippets.

@MaraScott
Created March 7, 2013 03:01
Show Gist options
  • Select an option

  • Save MaraScott/5105263 to your computer and use it in GitHub Desktop.

Select an option

Save MaraScott/5105263 to your computer and use it in GitHub Desktop.
Name : add_image_size() - Language : PHP - type : function - Platform : wordpress - tag : add_theme_support, post-thumbnails, set_post_thumbnail_size
<?php
// see : https://workflowy.com/#/7a7c77bb-b1f0-8b7a-1979-62ece0658eb8
// to put in functions.php
if ( function_exists( 'add_theme_support' ) ) {
// wp thumbnails (sizes handled in functions.php)
add_theme_support('post-thumbnails');
// default thumb size
set_post_thumbnail_size( 326, 100 ); // default Post Thumbnail dimensions
}
if ( function_exists( 'add_image_size' ) ) {
// new image size
add_image_size( 'new', 340, 553, true );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment