Default sub-pages on WordPress Multisite
wp_insert_post() returns a post ID for the fresh post. You can use that ID to set a parent post. Example $about_id = wp_insert_post( array ( ‘post_title’ => ‘About’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ) ); wp_insert_post( array ( ‘post_title’ => ‘Information’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ‘post_parent’ => $about_id, ) ); In your … Read more