0

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 ?

2
  • 1
    You've asked 8 questions, and accepted zero answers. You should start accepting some answers if you want people to keep answering your questions. Jul 4, 2011 at 12:42
  • 1
    I didn't even know about the accepting system of this site, but now I'll accept answers I promise
    – Mike
    Jul 4, 2011 at 20:04

1 Answer 1

3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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