I would like to add multiple featured image in meta box in post editor area apart from default available featured image.
I have added the meta box but i have no idea on adding the featured image functionality.
function another_image_custom_meta() {
add_meta_box('another_meta', __('Another Image'), 'another_image_callback', 'another','side');
}
add_action('add_meta_boxes', 'another_image_custom_meta');
Where another in fourth field is my custom post type.
function another_image_callback($post) {
wp_nonce_field(basename(__FILE__), 'another_nonce');
$p_stored_meta = get_post_meta($post->ID);
?>
<p>
Another featured image
</p>
<?php
}
Above functions works fine it show the meta box.
How can i add the link with image upload and save it as featured image to the corresponding post. Like default featured image i want the same function here. can anyone help?