I know the options I give dont really makes use of WP’s full potential.
The thing is that there are ideas for the future to make some options open again, hence the need of WP. Besides that, it needs to be low maintenance.
So WP is actually the best option for this project. Everything is ready to go except for the page which needs to be created every time a new site is created. And as I said before, WP has this code somewhere because there are already pages created everytime a site gets made.
Now I tryed to make the following code for functions.php but as I expected it doesnt work.. perhaps someone could help me with making this code work (debug it?)
add_action('activate_blog','my_default_pages');
function my_default_pages(){
$default_pages = array('About','Home','My Store','My Address');
$existing_pages = get_pages();
foreach($existing_pages as $page){
$temp[] = $page->post_title;
}
$pages_to_create = array_diff($default_pages,$temp);
foreach($pages_to_create as $new_page_title){
// Create post object
$my_post = array();
$my_post['post_title'] = $new_page_title;
$my_post['post_content'] = 'This is my '.$new_page_title.' page.';
$my_post['post_status'] = 'publish';
$my_post['post_type'] = 'page';
// Insert the post into the database
$result = wp_insert_post( $my_post );
}
}
I also tryed the hook: wp_head
and the hook: wpmu_activate_blog
Let’s look at it from a different angle for a second…
Are the USERS making these sites themselves or are you generating them?
Because if you’re making them, Blog Copier would be a fantastic idea here. Just make a ‘sample’ site, and use that to copy everything when you make a new site.
http://ww.wp.xz.cn/extend/plugins/blog-copier/
The users are making it themselves.. they go to the main website and register to create their own site and add content themselves. There should be nothing I should do..