Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. //code Write in functions.php
  3.  
  4. add_theme_support( 'post-thumbnails');
  5.  
  6. add_image_size( 'post-image', 600, 200, true );
  7.  
  8. /*
  9. Wordpress crop an image 5 sizes.
  10.  
  11. thumbnail // Thumbnail (default 150px x 150px max)
  12. medium // Medium resolution (default 300px x 300px max)
  13. large // Large resolution (default 640px x 640px max)
  14. full // Original image resolution (unmodified)
  15. */
  16.  
  17. //Initial the link in a variable
  18. $image_variable = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
  19.  
  20. // For call the image link
  21. <?php echo $image_variable[0]; ?>
  22.  
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement