In the loop, I'm able to print a post's thumbnail inside an img tag, but I can't retrieve the thumbnail image's URL.
Here's my code:
<?php
if (have_posts()) :
while (have_posts()) : the_post();
the_post_thumbnail($post->ID); // This works
echo(wp_get_attachment_thumb_url($post->ID)); // This doesn't work
echo(wp_get_attachment_url($post->ID)); // This doesn't work, either
endwhile;
endif;
?>
Does anybody know why?
Thanks!