To add a page called My Blog Page to all new blogs
and to set the About Page as the front page
and to set My Blog Page as the posts page:
Start with your cets_blog_defaults.php file installed at
wp-content > mu_plugins> cets_blog_defaults.php
(download plugin at http://wpmudevorg.wordpress.com/project/New-Blog-Defaults )
Add exactly what tarmentano (above) says:
$cets_blogdefaults = array(
// added the following code
'show_on_front'=>'page',
'page_on_front'=>2,
'page_for_posts'=>7,
//added the following code after update_option($key, $value);
update_option('show_on_front', 'page');
update_option('page_on_front', 2 );
update_option('page_for_posts', 7 );
If you haven't already somehow added more pages (eg through core hacking) then change the 7 to 3 in both places above.
Then insert this at the end of cets_blog_defaults.php, before the ?>
(Thank you http://gregorygrubbs.com/wordpress/how-to-give-wpmu-blogs-default-properties-theme-and-pages/ )
function prime_the_blog($blog_id) {
// add_blog_option( $id, $key, $value ) at http://codex.wordpress.org/WPMU_Functions/add_blog_option
add_blog_option($blog_id, 'generate_new_page', 'generate_new_page');
switch_to_blog($blog_id);
$postdata = array('post_parent' => 0,
'post_status' => 'publish',
'post_title' => 'My Blog Page',
'post_name' => 'my-blog-page', /* the slug */
'page_template' => 'page.php',
'post_type' => 'page');
$newid = wp_insert_post($postdata);
if ($newid && !is_wp_error($newid)) {
add_meta($newid);
} else {
// your error handling code
}
}
add_action('wpmu_new_blog', 'prime_the_blog');
Now you have everything with no core hacking. I'm no expert; I just never give up. So let me know if this works for you, and please tell me what I code I could put for // your error handling code.
In my case I also created this which I put on my page templates. It overrides the display of the page name (for instance About) when it is set to the front page to read My Site Name Home:
<h1><?php if (is_front_page()) : echo bloginfo('name') . ' Home';
else : the_title();
endif; ?></h1>
Used with wp_page_menu...
wp_page_menu(array(
'show_home' => get_bloginfo('name') . ' Home',
));
...the default site navigation now looks like this for new blogs:
My Site Name Home [a static front page]
My Blog Page [posts page aka the blog]