I am scrapping contents from my others sites into my wordpress site, i did all and below is my insert query
$my_post = array(
'post_title' => $my_title,
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array(5),
'post_content' => $res_final,
'post_date' => date('Y-m-d H:i:s'),
'post_date_gmt' => date('Y-m-d H:i:s'),
'post_type' => 'post'
);
$post_id = wp_insert_post( $my_post );
I can able to insert my titles and contents and yes it is displaying :), even i can see images inserting into the post as image comes along with the content, but i have planned to take the image alone from the content and stored separately as a post image so that it will come in the front page.
Any help on how to add the image into the post, and what is the best way to insert my image URL, an insert query to do this. Please help me