In WP2.0, I have uploaded an image using the new file upload area. I see how to insert the image into the post, but how do I reference it in the template? The goal is to add a template tag to single.php, so that the image associated with each post is pulled in, bit in a different place than the post text.
I tried adding a custom field with the name of the image, but the file upload thing tucks the images into dated subfolders, so I can't access them using the same path for all. I have also tried accessing the image using the _wp_attached_file custom field (from the custom fields popup menu), but with no success.
I have seen it mentioned that uploaded images are treated internally as sub-posts, but I can't find any documentation for how this works.