upload featured image from front end using wordpress add media button

add below code after echo $attach_id....

set_post_thumbnail( $post_id , $attach_id);

Leave a Comment