When i run the function wp_insert_post(), it inserts two identical posts instead of one.
By placing echo’s, I have confirmed that the function is not called twice.
Here is some of my code:
// Insert Pages $about = array( 'post_type' => 'page', 'post_status' => 'publish', 'post_title' => 'Om webbplatsen', 'post_content' => 'Content More content And even mode content' ); wp_insert_post($about);
You can download my full theme here;
The wp_insert_posts() is called in functions.php at row 44.
Thankful for any help!
- The topic ‘wp_insert_post() inserts 2 posts’ is closed to new replies.