Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
add_action('after_setup_theme', 'uckan_create_pages');
function uckan_create_pages(){
$awesome_page_id = get_option("awesome_page_id");
if (!$awesome_page_id) {
$post1 = array(
'post_title' => "Sayfa Adınız!",
'post_content' => "",
'post_status' => "publish",
'post_type' => 'page',
);
$postID = wp_insert_post($post1, $error);
update_post_meta($postID, "_wp_page_template", "template-giris.php");
update_option("awesome_page_id", $postID);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment