Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm creating a multi site and would like to have:

  1. A few pages that are automatically created with the new site (at the moment only the default home and sample page are created with a new site, anyone know how that is being done?)

  2. Even better but maby separate, a way to create pages in a form (on the register form or otherwise)

so that means optimally i want 4 pages (with content) made when a site is registered, and then a form asking them for the titles of 2 more pages that get created.

answers or ideas for either much appreciated!

share|improve this question

1 Answer 1

Not sure about multisite, however it usually works similarly to single site, so the following info may be useful:

There is a pluggable function (ie you write your own which will run instead of wp's function)

"wp_install_defaults"

Put your function in a 'dropin' plugin for install.php

and wp will use your function to create defaults instead of the wp defaults.

More info see:

Repeatable configuration package http://hakre.wordpress.com/2010/05/01/must-use-and-drop-ins-plugins/

share|improve this answer
    
great, but still a little bit over my head...but maby i did it anyway! I went in Function.php (in the theme) and added code from update.php (seems i dont have character allowance here to post in code but some is ` if ( is_multisite() ) $first_page = get_site_option( 'first_page', $first_page ); $first_post_guid = get_option('home') . '/?page_id=2'; $wpdb->insert( $wpdb->posts, array( 'post_author' => $user_id, ` –  petergus Nov 28 '11 at 15:04
    
sorry if my comment is inclear...just wondering if there is a cleaner way to do this then dropping it in functions.php, or is that what you are ultimately suggesting? –  petergus Nov 28 '11 at 15:49
    
Tested with Multisite and works :o) :::: @user10580, there is no functions.php involved in this. The link about Must-use and Dropins plugins explains what you are missing. Take a look at this Q&A as well. –  brasofilo Dec 9 '12 at 2:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.