I have the following code. It seems like the code runs fine till it actually inserts the post into the database. Then the code after that doesn't work, almost as if once the post is inserted the code breaks off.
<?php
echo "starting test";
$my_post = array(
'post_title' => 'My post',
'post_content' => 'This is my post.',
'post_status' => 'publish',
'post_author' => 1,
'post_category' => array(17)
);
echo "<br/>inserting post";
// Insert the post into the database
$thepost = wp_insert_post( $my_post, $wp_error );
echo "<br/>post inserted";
?>
the line "post inserted" never shows up, as iff the wp_insert_post almost kills the file once it executes?