Advertisement
FlashBuddy

Grab & Show WordPress Featured Image

Jun 6th, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Flasy Buddy's method of displaying the featured image of a post or page in a WordPress template.
  2.  
  3. <?php if (has_post_thumbnail( $post->ID ) ): ?>
  4. <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
  5. <div class="featured-thumbnail">
  6. <a href="<?php echo $image[0]; ?>" title=""><img src="<?php bloginfo(template_directory);?>/timthumb.php?src=<?php echo $image[0]; ?>&height=150&w=150&zc=0&q=90" alt="" /></a>
  7. </div>
  8. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement