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
- Website parent child relationship
- Create a “Dummy” parent page for a hierarchy in page listing?
- Automatically create child pages when saving a (parent) page
- Allow only new sub-pages to be created
- Some pages are missing from the Parent Page select in the Editor
- Create child page within custom post type
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Remove parent slug for child pages
- Show content if parent page has children
- Easy way to process search results before displaying
- Only allow new subpages to be created
- Display posts of custom type in hierarchical order
- Load parent pages when there are no child pages
- Query in a Hierarchical Custom Post Type for Children vs Siblings
- Custom post type hierarchical permalinks not behaving as expected for parent/child pages
- select a private page as parent for another private page
- Deleted pages showing up when querying for child pages
- Add theme templates for child categories into the template hierarchy
- Can I make WordPress use a custom template for a child page
- meta_key & meta_value not working with get_pages and custom taxonomy
- How to add numeric slug for child page in WordPress 5.9?
- WordPress pages with hierarchy
- Load child template based on parent
- Need wp_query to return all children and grandchildren
- How to get specified parent page title in my function
- Best way to give site sub-page it’s own domain?
- get permalink of page children in loop
- List child pages by slug not ID?
- Child post with numeric only slug keeps redirecting to parent
- Verify if the current page has at least one published child
- Next and Previous Posts of Same Parent
- Child theme does not load all style
- Programmatically add existing pages and subpages to Appearance Menu
- Sort order of next/prev sibling page
- Versioned Custom Post Type (Not the same as revisions)
- get_pages() & “child_of”
- Custom post Type, child of a Page?
- What code should I use to display children of a custom post?
- How do I Turn This Into An if statement?
- Installing plugins and using complex folder structure with child theme in WordPress
- Weird behaviour on Edit Menus screen
- Listing subpages title and content and styling the first iteration differently
- How to highlight 1st level menu item based on actual page
- Get Child Page IDs by Parent ID
- List of child custom post types lists all custom post types
- Redirect to first child on Custom Post Type (without template)
- How to display childrens custom fields?
- Display child page content of a specific parent on home page
- When listing child pages run out of memory
- Is there a way to dump all registered sidebar/widget?
- Parent Page > Child Page Menu
- Listing all child-pages of a parent-page on the parent-page and each child-page?
- Child and Parent Pages list of sub pages
- Display a list of sub-pages of Custom Post Type Parent Page
- I have a problem with displaying children pages of custom post type
- Display list of pages that contain a certain string within the slug
- WordPress Child Theme Template auth_redirect wrapper
- Child Theme problems
- How to show the view more on my display of pages shortcode
- Why is wp_list_pages altering $post->ID of the page?
- Custom post type child page 404
- WordPress Template works until page becomes a child
- How to get child pages and add unique class only to active page?
- How can I structure my pseudo footer nav code with wordpress codex code?