I'm using the WordPress "attachment" feature to allow end users of my theme to upload images that will appear above the post content (not inserted into the post itself).
The only problem I have is that there is not a field to allow the end user to specify the link that should be loaded when the end user clicks on one of the attached images. I'd like to add this field to the post attachment editor (the one that lists the "Gallery" of images attached to the post).
Alternately, and perhaps in addition, I'd like to be able to do the same thing when viewing images via the Media manager listing.
Currently, I'm using the "description" field to store the hyperlink to the image. and retrieving it like so (works perfectly but description is not semantic to link destination):
if ($images = get_children(array('post_parent' => get_the_ID(),'post_type' => 'attachment','post_mime_type' => 'image', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC' )))
{
foreach( $images as $image ) :
echo "<a href='".$image->post_content."'><img src='".wp_get_attachment_url($image->ID, 'medium')."' /></a>";
endforeach;
}
}