post_parent
must be a single number, not an array. Each post can have only one parent. If you want to insert posts for multiple parents, use something like this:
foreach ( array(17, 25, 27, 29) as $parent )
{
wp_insert_post (
array(
'post_title' => $something,
'post_type' => 'page',
'post_author' => 1,
'post_status' => 'publish',
'post_parent' => $parent
)
);
}
Related Posts:
- Get page id by template
- How can I keep the content of my pages version controlled?
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- How do I convert a page’s title to lower case?
- page title, parent tilte and grand parent title
- How to add jQuery script to an individual page?
- WordPress page edit does not save selected template
- Manual excerpts for pages not working on Search
- How do I set and list page_template with wpcli?
- How to get post or page excerpt using post_excerpt
- Different fields in My Profile page depending on user role
- Object gets unwanted width and height
- Automatically set page order on create page
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- What’s the most minimal way in which a page can be hooked into WP?
- Associate Page with User
- wordpress with many custom styled static pages
- Limit the number of pages created by the paging
- One page – Multiple parents?
- Check whether the child page has siblings
- How to re-order pages en-masse
- wp_dropdown_pages default value
- how to get specific page content
- is_page condition not working
- How to create a page that contains a list of post titles from specific categories?
- How WordPress manages nested dropdown?
- Get all children page ID’s including parent by title
- How to modify the default WordPress ‘Pages’ widget to have titles on the anchor tags?
- Creating a 3-column layout on a WordPress Page
- Create page that is not deletable
- is_home() returns TRUE on page template
- Blank Pages with # URL & Google
- Moved WP from example.com/blog to example.com, cannot add pages now
- Adding New Users to Your WordPress Site for edditign only one page
- How to add pagination to a single wordpress page with lot of text
- Removing Parent Page URL While Keeping the Navigation Intact
- Custom page template for multiple pages
- IF user is logged in only show certain page
- hard coded html / php pages on local host directory don’t show up in WP dashboard
- How to have a separate page? What should be the link to that page?
- the_content of template page
- Post Fetching Ignoring Sort_Column?
- WordPress theme: Add page content to the bottom of the Contact form
- 404 Page not found
- Styling Previous/Next Pages differently from Index
- When will body has class “page-id-0”
- Page access only from a specific page in wordpress website
- How to show ‘tags’ in ‘WordPress Pages’ [not Posts]
- pre-existing data, and entities
- How do I evaluate a get_posts array with is_page?
- Automatically generate pages from SQL
- require_once not working
- Displaying posts on homepage – Template Page
- Need 404 behaviour for blank parent page
- Showing Different Code on Pages With Different Layouts
- How to make title for home to be News, but if page has parent then its name else just post/page name
- advanced paging in wordpress
- How do you set the default page in WordPress?
- Get all pages to display at once
- Show specific page on main index instead of latest
- Add Filter to Ignore a Post/Page or a Number of Post/Pages
- I want to create a Weebly site and have it show up as static pages on a WordPress site
- How to use the full page
- anchor tag in header not working on other pages except the home page
- Using WP just to edit pages of an existing site
- $page = get_page_by_title CONTAINS
- Exclude child pages args array
- Author page like wordpress answers
- How to make transition slider load before home page
- Block to Popup Page, on demand?
- Odd twitter meta data description on all pages
- Stop playing music (rev slider) when user opens new tab
- Include parent page in list of child pages
- How to sorted Parent Page in WP-admin
- how can i display children of my parent page in one of the children page (wordpress)
- How to select what posts goes into which custom page template?
- Displaying all pages which comes under a category id
- Deleted WordPress page appears in Google Search Results
- WordPress redirects to login page when I enter url.com/index.php
- If page or sub page not working as expected
- How to see the dashboard of a downloaded wordpress website?
- Remove and change pages label
- Calling JavaScript for specific page irrespective of whichever theme you select
- Access link page and not folder content of that link
- How can I get the page from menu as posts?
- Post id(login page) not found
- Setting Default Screen Options
- disable trashability for certain pages
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- If searched in a category show different 404 page
- pages won’t show on front page using loop or pre_get_posts
- How can I cycle posts with a #next and #previous script?
- Using Page/Post Slug In Link / URL
- List of pages – AJAX load more
- one time visit to the page
- How to display text of a page in home or custom page?
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount
- Fresh WordPress installation not able to simply show page content