2671 posts
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
  • United Kingdom
  • Won a Competition
Chuckanucka says

Hi,

Does anyone know if its possible to get the title, caption and link from a image attached with the wordpress media uploader.

i.e from here: http://en.blog.files.wordpress.com/2008/12/picture-13.png

thanks. Chuck

228 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
stevebluck says

This gets the attachement URL and echos it

echo wp_get_attachment_url(postID here);

This link has loads of info on the subject.

http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/

2671 posts
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 50 and 99 users
  • Sold between 100 000 and 250 000 dollars
  • United Kingdom
  • Won a Competition
Chuckanucka says

thanks for the link,I seen it before but could not find what I was after. I am able to grab the first image attached to a post, but not its properties.

228 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
stevebluck says

Look at the end of the post:

$attimg   = wp_get_attachment_image($image->ID,$size);
            $atturl   = wp_get_attachment_url($image->ID);
            $attlink  = get_attachment_link($image->ID);
            $postlink = get_permalink($image->post_parent);
            $atttitle = apply_filters('the_title',$image->post_title);

$atttitle is the image title.

by
by
by
by
by
by