how to get image full path from WP_Post Object?

I want to get image full path so that I can apply it in the src attribute of image element.

What I am getting right now is the image, generated from function: the_post_thumbnail(); which I can’t apply to image element.

Read More

What I did so far is:

        <?php
            $d=get_cat_ID( 'news' );
            $catquery = new WP_Query( 'cat='.$d.'&posts_per_page=1&order=DESC' );
            while($catquery->have_posts()) : $catquery->the_post();
                  the_post_thumbnail();
            endwhile;
        ?>

And what I want is; path of image with its name as below:

http://example.com/folder1/wp-content/uploads/2013/12/image.jpeg

Related posts

Leave a Reply

1 comment