WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to do something as simple as the_post_thumbnail('large') but I want the URL of the image only, not the HTML which goes with it. Is that possible ?

share|improve this question
You've asked 8 questions, and accepted zero answers. You should start accepting some answers if you want people to keep answering your questions. – Chip Bennett Jul 4 '11 at 12:42
I didn't even know about the accepting system of this site, but now I'll accept answers I promise – Mike Jul 4 '11 at 20:04
up vote 3 down vote accepted

Use get_post_thumbnail_id() to retrieve ID, then wp_get_attachment_image_src() to retrieve array, that will have URL as first element.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.