Hi folks, just wanted to answer a few questions I had that other people here asked as well, which were:
1) page ordering
2) how to set a page as a front page
so here's my code snippet
$wpdb->insert( $wpdb->posts, array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
'post_content' => __('Welcome to my Homepage!'),
'post_excerpt' => '',
'post_title' => __('Home'),
'post_name' => __('home'),
'post_modified' => $now,
'post_modified_gmt' => $now_gmt,
'post_status' => 'publish',
'post_type' => 'page',
'to_ping' => '',
'pinged' => '',
'post_content_filtered' => '',
'menu_order' => -2,
'comment_status' => false,
'ping_status' => false
) );
//inserted id
$page_id = $wpdb->insert_id;
update_option("show_on_front", "page");
update_option("page_on_front", $page_id);
//change template inserted page
$wpdb->query("insert into $wpdb->postmeta (post_id,meta_key,meta_value) values ($page_id,'_wp_page_template','templatefile.php')");
'menu_order' is the setting you need to put in to set page ordering.
the two lines of 'update_option' is how you set the page to be the default front page.
you will also need to tell wordpress the alternative page it will put your blog listings on. for that page, replace both 'update_option' lines with this single line:
update_option("page_for_posts", $page_id);
good luck!