wp_insert_post( $my_post );を使いたいとき 関数私は次のエラーを受け取ります:
致命的なエラー: create_initial_post_types() (以前は /home/izradawe/public_html/mydomain.com/wp-includes/post.php:20 で宣言) を /home/izradawe/public_html/mydomain.com/wp-includes/post で再宣言できません.php 152 行目
これで私を助けてもらえますか?
私が使用しているコード:
include_once('../wp-load.php');
include("../wp-includes/post.php");
// Creating post
$my_post = array(
'post_title' => 'My post',
'post_content' => 'This is my post.',
'post_status' => 'publish',
'post_author' => 1,
'post_category' => 5,
'post_type' => 'post'
);
// Insert the post into the database
wp_insert_post( $my_post );