if you follow the link I provided, you see the same link somewhere there as what you just gave me. I understand that plugin just give the site-admins options (or removes them).
To get a better view of what Im trying to create:
When a new site-admin is registrated (which they can without permission) they get a website like "mysite.example.com". If they visit that URL they get to see "Home" which displays a blog with 1 example post in it and an "About Me" Page.
I removed some code in wp-admin/includes/upgrade.php to prevent the blog from being made by default. So now they only get the "About Me" Page after registrating. I also Editted some code in the same file which gives them another Page instead of "About Me".
Till now it all worked out. But I dont only want a replacement for "About Me", I want to give that replacement a template (which can normally be set on the right) I created (yes the template works).
So what Im guessing is that I need to change this code below to assign a template to it:
// Second Page
$second_page = sprintf( __( "" ), admin_url() );
if ( is_multisite() )
$second_page = get_site_option( 'second_page', $second_page );
$second_post_guid = get_option('home') . '/?page_id=3';
$wpdb->insert( $wpdb->posts, array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
'post_content' => $second_page,
'post_excerpt' => '',
'post_title' => __( 'Home' ), // Shows in Menu bar
/* translators: Default page slug */
'post_name' => __( 'front-page' ), // URL -> example.com/'xxx'/
'post_modified' => $now,
'post_modified_gmt' => $now_gmt,
'guid' => $second_post_guid,
'post_type' => 'page',
'to_ping' => '',
'pinged' => '',
'post_content_filtered' => ''
$wpdb->insert( $wpdb->postmeta, array( 'post_id' => 3, 'meta_key' => '_wp_page_template', 'meta_value' => 'homepage.php' ) );
The template name is "homepage.php" and I uploaded it to example.com/wp-content/themes/mytheme
In the code above I tryed to add it on the bottom (without luck)
'meta_value' => 'default' ) );