Raul
Raul

Reputation: 1024

How to output the thumbnail of the featured image Wordpress?

I want to output the thumbnail of the featured image of a post inside one of my widgets? How can I do that inside the loop, in Wordpress. I'm using version 3.3.1

Upvotes: 0

Views: 2189

Answers (1)

Shebo
Shebo

Reputation: 297

you can use

<?php the_post_thumbnail(); ?> 

or if you want only the image src and not all the wordpress's html output, use this:

<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>

references:

http://codex.wordpress.org/Function_Reference/the_post_thumbnail

http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail

Upvotes: 1

Related Questions