You can use get_pages with a limit of 1:
$pages = get_pages([
'child_of' => $post->post_parent,
'number' => 1,
]);
if ( $pages ) {
$first_page = current( $pages );
}
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
- Adding title and description to subpage’s featured image
- Show list of Child Post in Parent Post
- 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
- Get parent page url to show up when it is in child pages
- Check if is on child-page of a particular page
- Can I have two child pages of different parents with the same name?
- Remove WordPress theme from a specific page
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- Advanced Custom Fields – Get custom fields from parent page
- Child Pages Loop
- Get Permalink for the top level parent of child pages
- Custom user role that can only edit specific (non-custom-type) page and all child pages [duplicate]
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Show content if parent page has children
- Delete Child Posts
- Display child pages on a parent and child page using Featured Thumbnails
- Can’t change parent page
- Javascript that will execute on only child pages of a specific parent
- What is the optimal way to filter out subpages from admin?
- Share parent path between Custom Post Types and Pages?
- Load child template based on parent
- Custom Field returning Numerical Value for Image rather than URL
- Need wp_query to return all children and grandchildren
- How to get all child pages in their parent page?
- remove/hide pages from users backend
- How do I list the child of a child page [duplicate]
- Custom rewrite rule for hierarchical custom post type
- List children on child post
- child of post type (custom)
- Menu with parents, children and or siblings pages display
- Append a code when at the current page in wp_list_pages()
- wp_insert_post if page doesn’t exist under current page
- How to retrieve parent menu item name of current submenu item
- Combining ‘depth’ with ‘include’ in wp_list_pages()
- Removed custom post type slug but not working for child pages
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- get_the_title() gets printed out twice
- Display child pages in sidebar of parent page in wordpress
- Display child pages in a parent page? [closed]
- How to Create a Random List of Child Pages
- List all posts with the parent or grandparent of a page with a specified ID
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Sort and display pages with specific custom field (not tag)
- How to use wp_list_pages on a grandparent page
- If/Else child list for Custom Post Type single template within loop?
- Search anything from a Child and Sub-Pages of their Parent page
- How do I find out which (page) template file my custom child post is looking for?
- 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?
- How do I list subpages in post editor view?
- Getting a value from a custom field from a page that shares a parent with the current page
- Displaying Child Page’s Information
- WP_Query doesn’t return some child pages even though the database shows them
- Load one page with parent and child pages
- Childpage title + content on Parent Page
- Pages redirecting to homepage
- Display title of child pages in shortcode
- 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
- 404 error on second page load for child-pages
- How to make in post Parent page children page list nummbered
- Query sub subpages based on specific date?
- How to create archive child pages with good Yoast SEO meta?
- Displaying child pages and file URL in an ACF relationship field shortcode