This would do it..
function get_child_pages() {
global $post;
$query = new WP_Query( array( 'post_parent' => $post->ID ) );
if ( $query->have_posts() ) {
echo '<ul>';
while ( $query->have_posts() ) {
$query->the_post();
//Child pages
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
echo 'Sorry, No posts found.';
wp_reset_postdata();
}
Related Posts:
- how to properly list child pages in sidebar?
- Get custom field value from Grandparent Page for Parent and Child Pages
- Given the page id, check if it has children
- How to get a list of all recently published child pages?
- WordPress get the child pages of current page
- Show siblings (if any) and parents
- List child pages of current page but limit to specific year
- Child page excerpt
- Create WordPress child page from page actions
- How to show child page without providing ID so it’s dynamic
- is_child() function
- Drop-Down Menu of Current Child Pages
- Get WordPress Child Page IDs
- Displaying the first child page of the parent page
- Adding title and description to subpage’s featured image
- List subpages in order
- parent page grabbing wrong url for child pages – get_page_uri($pageChild)
- i want to get the parent id, only on parent -> child -> child page
- Get first level children of a page ID
- Only one parent page showing
- Create a list of pages excluding children of selected page
- 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
- List child pages, exclude the current page
- Listing Child Pages in Random order
- How to display child pages with in a limited child content?
- Display Tags of Child Pages
- Get post_meta of children and compare to current page ID
- 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
- Display a list of child posts on parent posts of a custom post type
- 404 on child page when parent page slug is identical to custom post type
- Is there a default template file for child pages / subpages?
- Prev/Next child navigation for current page?
- How can I programmatically create “child” pages on theme activation?
- List child pages of a specific page
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- Using pagination with get_posts on page type
- Add class to the items in wp_list_pages
- Allow users to publish child pages of the pages they have access to edit
- Displaying child page content of a certain parent
- Get only the grandchildren, not the direct children of page/current page?
- Query children and parent title
- Paginate Child Pages Content on Parent Page
- Remove custom post type slug not working for child pages
- Page as a child of a Custom Post Type
- How to target children of child pages
- get_posts() excluding all children of a specific post/page
- List child pages of specific page using shortcode
- Custom page slug without creating a WP page
- Set order of returned items in the WP_Query() class/function
- Pagination of a WP_Query Loop in a child-page page template
- load common thank you template with different content for different pages
- Schedule Page to Menu [duplicate]
- Display the contents of a custom field of a page on their child
- How to hide all child pages with post_query?
- Trouble with parent and child conditional tag to show content
- How to display all subpages and short by year
- Display Child Pages of Custom Post Type Parent Page
- Display child pages on parent page: 404 message overrules shortcode in page
- How to populate a parent page with its child subpages and associated templates
- query pages by a childs publish date
- Removing Parent Page URL While Keeping the Navigation Intact
- Organizing Your Pages
- Custom page template for multiple pages
- query if page has not child
- Return value of get_permalink(0) and get_the_title(0)
- How to have a custom URI path for specific page template
- List all posts with the parent or grandparent of a page with a specified ID
- complex get_posts() query to select child pages
- Page access only from a specific page in wordpress website
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- Page that links to category content
- Check if parent page has child page of certain slug
- Child Theme not overwriting Parent theme php file
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- How to use POST method using custom wordpress button?
- Standard Page Child of CPT Not Found (404)
- Creating navigation out of specific IDs and their children?
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- WP_Query doesn’t return some child pages even though the database shows them
- Load one page with parent and child pages
- List of child pages fetch next results at link click
- Pages redirecting to homepage
- Display title of child pages in shortcode
- Showing main menu and child menu in diffent places in a same page
- Elegant way to signify inheritance and relationship between posts
- How to check if the current page’s parent is one of 2 different ID’s
- Detecting top parent category fails on home page
- How to make in post Parent page children page list nummbered
- List of pages – AJAX load more
- I have a website issue I am trying to resolve