-1
votes
3answers
140 views

Programatically add a page in Wordpress

I am trying to add a page to WordPress programatically. I am using this code: function add_media_page(){ if(!(is_page('My New Post'))){ // Create post object $my_post = array( 'post_title' ...
3
votes
2answers
464 views

wp_insert_post breaks rewrite rules

I'm using wp_insert_post to programmatically add content to a site. This works fine with posts, categories and tags, but not with pages. When I attempt to add a page (i.e. post with post_type=page), ...