//Create an array containing the IDs of pages that are children of page ID XXX
$args = array(
'post_type' => 'page',
'post_parent' => XXX,
'fields' => 'ids',
'posts_per_page' => -1,
);
$qry = new WP_Query($args);
//Convert the array into a string
$string = implode(', ', $qry->posts);
//Display the list of IDs - for testing purposes.
//var_dump($string);
//Create a list of all pages excluding the list of child pages
wp_list_pages(array('exclude' => 'XXX,'.$string, 'title_li' => ''));
Related Posts:
- how to properly list child pages in sidebar?
- How to get a list of all recently published child pages?
- Show siblings (if any) and parents
- List child pages, exclude the current page
- Listing Child Pages in Random order
- Add class to the items in wp_list_pages
- Load parent pages when there are no child pages
- Exclude pages with certain template from wp_list_pages
- Get custom field value from Grandparent Page for Parent and Child Pages
- Given the page id, check if it has children
- inserting custom li class to wp_list_pages
- List child pages of specific page using shortcode
- WordPress get the child pages of current page
- How to get specified parent page title in my function
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- List child pages by slug not ID?
- Menu with parents, children and or siblings pages display
- Append a code when at the current page in wp_list_pages()
- List child pages of current page but limit to specific year
- Child page excerpt
- Combine get_page_by_title to exclude pages from wp_list_pages
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Create WordPress child page from page actions
- How to show child page without providing ID so it’s dynamic
- is_child() function
- Exlude pages from wp_list_pages
- wp_list_pages() exclude category
- Drop-Down Menu of Current Child Pages
- Exclude pages by menu order
- Get WordPress Child Page IDs
- Displaying the first child page of the parent page
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Sort and display pages with specific custom field (not tag)
- Dynamic menu wp_list_pages displaying only current branch including: current page, his siblings and its childs
- Adding title and description to subpage’s featured image
- Show list of Child Post in Parent Post
- List subpages in order
- How to use wp_list_pages on a grandparent page
- parent page grabbing wrong url for child pages – get_page_uri($pageChild)
- Check if page has subpages
- i want to get the parent id, only on parent -> child -> child page
- Exclude child pages args array
- Disable the link on certain pages
- Get first level children of a page ID
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Only one parent page showing
- Creating navigation out of specific IDs and their children?
- WordPress Betheme: Unkown subheader image of a child page
- How to disable alphabetical sorting page
- Structure for calling child pages
- Child pages and sub-pages do not appear. Why?
- Add link to parent page in list of child pages
- Display child pages full template including the content
- PHP: Why does my code work in index.php but not a widget?
- Exclude from wp_list_pages by template
- How to display child pages with in a limited child content?
- Why is wp_list_pages altering $post->ID of the page?
- Display Tags of Child Pages
- Get post_meta of children and compare to current page ID
- Get current post’s child page?
- How to make in post Parent page children page list nummbered
- Display the latest content from subpages of another page
- Limit the number of child page displaying
- Show the grandmother/father of the childpage
- How to Hard Set the Parent Page in Template
- Exclude pages by custom field (with yes/no) storing wrong data?
- Website parent child relationship
- How can I clone/copy all fields (post and meta) from parent CPT post to child (with synced fields?)
- wp query to get child pages of current page
- Exclude post ID from wp_query
- Dynamically exclude menu items from wp_nav_menu
- How do I exclude plugins from getting automatically updated?
- Get parent page url to show up when it is in child pages
- Check if is on child-page of a particular page
- Exclude Current Post from Recent Posts Loop
- A check for if is parent page, if has children, if has grandchildren
- Can I have two child pages of different parents with the same name?
- How can I hide children of draft pages using wp_list_pages()?
- Return parent post with its children using WP_Query?
- Remove WordPress theme from a specific page
- Create a “Dummy” parent page for a hierarchy in page listing?
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- exclude category from get_posts?
- Exclude Specific Term from Search
- Advanced Custom Fields – Get custom fields from parent page
- Exclude the category from the WordPress loop
- Show just one level of child pages, wp_list_pages woe
- Automatically create child pages when saving a (parent) page
- Display a list of child posts on parent posts of a custom post type
- Skipping first 3 posts in wp query
- Allow only new sub-pages to be created
- 404 on child page when parent page slug is identical to custom post type
- Is there a default template file for child pages / subpages?
- Child Pages Loop
- Prev/Next child navigation for current page?
- Shortcode producing headers already sent error
- Exclude certain category from latest updates
- Get Permalink for the top level parent of child pages
- how can I use WP_Query to exclude a specific tag.?
- How can I programmatically create “child” pages on theme activation?