use $wp_insert_post
function to create posts and to create sub posts of this use this function again and set post_parent = “name of post you created” see list of all arguments and usage of this function wp_insert_post
use $wp_insert_post
function to create posts and to create sub posts of this use this function again and set post_parent = “name of post you created” see list of all arguments and usage of this function wp_insert_post