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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by