Last active
April 30, 2018 03:01
-
-
Save mateusneves/ad50c04430fd735f2264239636747595 to your computer and use it in GitHub Desktop.
Wordpress: Add Additional Image Sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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