Easy way!
<?php
wp_get_attachment_url(get_post_thumbnail_id(get_the_ID()))
?>
You can try this.
<?php
$image_url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
?>
<a href="<?php echo $image_url; ?>" rel="prettyPhoto">
// Try it inside loop.
<?php
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
echo $feat_image;
?>
You can try this:
<?php
$feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
echo $feat_image;
?>
Simply inside the loop write <?php the_post_thumbnail_url(); ?>
as shown below:-
$args=array('post_type' => 'your_custom_post_type_slug','order' => 'DESC','posts_per_page'=> -1) ;
$the_qyery= new WP_Query($args);
if ($the_qyery->have_posts()) :
while ( $the_qyery->have_posts() ) : $the_qyery->the_post();?>
<div class="col col_4_of_12">
<div class="article_standard_view">
<article class="item">
<div class="item_header">
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url(); ?>" alt="Post"></a>
</div>
</article>
</div>
</div>
<?php endwhile; endif; ?>
This perfectly worked for me:
<?php echo get_the_post_thumbnail_url($post_id, 'thumbnail'); ?>