Please help! I have a form for users to submit posts, and I want them to be able to choose photos already in the media gallery based on category selected. I want to include radio buttons to choose between a few images that will attach to the post, become the featured image, or just echo out in a template file in this manner
<?php $custommeta = get_post_meta($post->ID, "CategoryImage", true); ?>
The value of the selected image will be the image url to echo out into the custom field.
I can not figure out the code to get the custom field in the form and get the value into the custom field. I think I should use add_post_meta but I am not completely sure how to incorporate it. Any help would be greatly appreciated.
I am using the plugin User Submitted Posts but I would take a general answer as well.