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.

How to set a Static page (example Sample Page with every WordPress install) as default fron page for every newly created site on multisite network. I mean when a new user creates a site on my multisite network a Page with custom name sets as front page automatically. Please tell me how to accomplish that.

share|improve this question
add comment

2 Answers

1) To set Your first page you can add new page as home.php in your directory. Wordpress by default take home.php as its first page if it is declared.

2) Go to settings->Reading->Front page display. You can set here your front page which will display when your site open.

share|improve this answer
add comment

Try the following code. Based on these two Q&A's (not tested):

add_action( 'wpmu_new_blog', 'process_extra_field_on_blog_signup', 10, 6 );

function process_extra_field_on_blog_signup( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
    switch_to_blog($blog_id);
    $homepage = get_page_by_title( 'Sample Page' );   
    if ( $homepage )
    {
        update_blog_option( $blog_id, 'page_on_front', $homepage->ID );
        update_blog_option( $blog_id, 'show_on_front', 'page' );
    }
    restore_current_blog();
}

Use it as a Must Use plugin.

share|improve this answer
add comment

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.