2671 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
+5 more
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
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
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
  • Has been part of the Envato Community for over 7 years
  • Has referred 100+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 50+ items on Envato Market
+5 more
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
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
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