Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //code Write in functions.php
- add_theme_support( 'post-thumbnails');
- add_image_size( 'post-image', 600, 200, true );
- /*
- Wordpress crop an image 5 sizes.
- thumbnail // Thumbnail (default 150px x 150px max)
- medium // Medium resolution (default 300px x 300px max)
- large // Large resolution (default 640px x 640px max)
- full // Original image resolution (unmodified)
- */
- //Initial the link in a variable
- $image_variable = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
- // For call the image link
- <?php echo $image_variable[0]; ?>
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement