The MU forums have moved to WordPress.org

Adding default page - how to assign a template to wpmu-functions.php (2 posts)

  1. denzel2364
    Member
    Posted 14 years ago #

    Hi there

    I have the following code to create a second default page

    $wpdb->insert( $wpdb->posts, array(
    		'post_author' => $user_id,
    		'post_date' => $now,
    		'post_date_gmt' => $now_gmt,
    		'post_content' => 'first page test. this is the first page. PLEASE TEST ME',
    		'post_excerpt' => '',
    		'post_title' => __('Contact'),
    		'post_name' => __('contact'),
    		'post_modified' => $now,
    		'post_modified_gmt' => $now_gmt,
    		'post_status' => 'publish',
    		'post_type' => 'page',
    		'to_ping' => '',
    		'pinged' => '',
    		'post_content_filtered' => ''
    	) );

    How do i assign a page template?

    Would this work? "'post_template' => 'myfrontpage.php',"

  2. chelgeson10
    Member
    Posted 14 years ago #

    I am having problems with assigning a page template to default pages as well...can anyone sheds some light on this?

About this Topic

  • Started 14 years ago by denzel2364
  • Latest reply from chelgeson10