Skip to content

Instantly share code, notes, and snippets.

@mateusneves
Last active April 30, 2018 03:01
Show Gist options
  • Save mateusneves/ad50c04430fd735f2264239636747595 to your computer and use it in GitHub Desktop.
Save mateusneves/ad50c04430fd735f2264239636747595 to your computer and use it in GitHub Desktop.
Wordpress: Add Additional Image Sizes
<?php
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'blog-thumb', 400, 9999 ); // 400px de largura máxima (e altura ilimitada)
add_image_size( 'main-thumb', 300, 250, true ); // corte/crop
}
?>
<?php echo get_the_post_thumbnail($post->ID, 'main-thumb'); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment