Guest User

Thumbnail

a guest
Aug 14th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php if(has_post_thumbnail($post->ID, 'thumbnail')):
  2. $image_id = get_post_thumbnail_id($post->ID);
  3. $image_url = wp_get_attachment_image_src($image_id, 'thumbnail', true); ?>
  4. <a href="<?php echo get_permalink($post->ID) ?>" class="post-thumb"><img src="<?php echo $image_url[0]; ?>" alt="<?php echo $post->post_title ?>" /></a>
  5. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment