安装WordPress
安装和激活主题
添加页面和文章
添加菜单
添加插件
更改设置
示例代码
// 在WordPress后台添加页面
function create_custom_page() {
$page_name = 'Custom Page Name';
$page_content = 'This is a custom page content.';
$page_template = 'page.php';
$post = array(
'post_title' => $page_name,
'post_content' => $page_content,
'post_status' => 'publish',
'post_type' => 'page',
'page_template' => $page_template,
);
wp_insert_post( $post );
}
add_action( 'init', 'create_custom_page' );