Created
September 21, 2013 14:20
-
-
Save amirkheirabadi73/6651074 to your computer and use it in GitHub Desktop.
Post Thumbnails
This file contains 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
Sample Functions.php: | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
set_post_thumbnail_size( 150, 150, true ); // default Post Thumbnail dimensions (cropped) | |
// additional image sizes | |
// delete the next line if you do not need additional image sizes | |
add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height) | |
} | |
in File : | |
<?php the_post_thumbnail( $size, $attr ); ?> | |
Read More: | |
http://codex.wordpress.org/Function_Reference/the_post_thumbnail | |
https://codex.wordpress.org/Post_Thumbnails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment