//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?
- Dynamically exclude menu items from wp_nav_menu
- Breadcrumbs showing Parent and Child Pages
- Display subpages under parent page as a list within a loop
- Display grandchildren on child and grandchild pages using wp_list_pages
- Get attached media only
- Multiple Conditions for Child Page Title
- Exclude One Category and its Subcategories using WP_LIST_FILTER
- Manipulate Output of wp_list_something: select menu instead of li’s
- Exclude category from category archive
- Do Not Display Parent Page if No Subpages
- Drag posts and pages so you can sort them in order
- Linking to Child Theme PHP Files
- Trying to return list of child pages for a template
- Displaying different page links on different pages
- Exclude image titles from search results
- Exclude all sticky posts front page twenty twelve
- query posts and split meta information into separate div’s
- How to Create a Random List of Child Pages
- include specific Pages to wp_list_pages with filter
- Get post and its children with WP_Query
- How to exclude posts that already appear in the main loop, from the category loop
- Thumbnails in ACF Query Results
- specific post is not excluded from the loop
- using pre_get_posts to exclude
- build child and anchestor three from post parent
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- Displaying Category in sidebar post widget but not in the loop on home
- Displaying Child Page’s Information
- How to exclude a category in the following Code?
- How to perform str_replace on the results of wp_list_pages
- Childpage title + content on Parent Page
- Showing Custom Menus in the sidebar
- wp_list_pages Format only on Recently Modified Pages
- Get first category only and excluding one