you can use the number param to limit the number of pages you want and get the custom field in the foreach loop 🙂 (child of = your parent page, or the current page)
$mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc', 'number' => 3, ) );
foreach( $mypages as $page ) {
$content = $page->post_content;
$content = apply_filters( 'the_content', $content );
?>
<h2><a href="https://wordpress.stackexchange.com/questions/61211/<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h2>
<div class="entry"><?php echo $content; ?></div>
<?php
}
Related Posts:
- Advanced Custom Fields – Get custom fields from parent page
- 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
- Advanced Custom Fields dynamic update_field
- Child page excerpt
- How to populate a parent page with its child subpages and associated templates
- 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
- 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 Child Page with custom fields within Parent Page
- Display Tags of Child Pages
- Get post_meta of children and compare to current page ID
- 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
- Displaying child pages and file URL in an ACF relationship field shortcode
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Unable to get Preview of Uploaded image within a Custom Meta box
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Capturing arbitrary semantic URL arguments
- Search with filters and title
- Order Custom post type loop by custom field (datepicker)
- Advanced Custom Fields Image Field returning ID instead of URL [closed]
- Display posts if a custom field value is equal to another custom field value
- sort by date in Advanced Custom Field
- ACF if / else checkbox [closed]
- meta_key & meta_value not working with get_pages and custom taxonomy
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Load child template based on parent
- Need wp_query to return all children and grandchildren
- ACF: how do I get the fields and its values of a specific group?
- Get Current Post ID in functions php, meta query filter
- add custom filters to the event calendar plugin programatically to frontend [closed]
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- wordpress ajax relationship query
- Query Pages and post excerpts dynamically
- Can a user find a child page?
- Is there a better way to pull in custom content without querying posts?
- ACF – add a group inside a repeater [closed]
- How to list Category list in ACF Pro’s Select Field to choose from [closed]
- filter wp_query result with custom field values
- Basic do shortcodes question
- ACF Clone Field – Set Default Value
- ACF save json to custom directory not working, default acf-json used instead
- Do comparision after updates hooks of acf-fields?
- Saving Post Data in Another Database
- WP_Query custom field pass the post id
- Pulling in content from another page [closed]
- Advanced Custom Fields – Check multiple Empty Fields [closed]
- Why do my quick edits for custom taxonomies not show on the post frontend?
- ACF flexible content block not showing on live site (works locally)
- Add a Call to Action Button to WordPress Post Thumbnail
- ACF: Display Google Map in frontend issues
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- Fancybox3 ACF repeater. URL strip out from the caption field
- Is it okay to use an ACF field to store a password for a protected area of a page?
- Which is faster: Loading images from the repo, or loading them using ACF Image Content via Media Library
- WordPress API response filter by ACF value
- ACF Pro Date Picker not coming through on Loop
- Show specific posts with WP_Query using ACF Post object
- ACF Taxonomy search on backend (Relationship field)
- Use an image’s url as argument in update_field function
- One set of Child Pages redirecting to Home page?
- Page permalink ending in “-2”
- Geo location query inside wp_query?
- using ACF datepicker to filter posts on a page
- How to finish this loop?
- How to query the content of a specific custom post type?
- Advanced Custom Fields and date picker, show posts only if the day is today no matter the year
- Conditional Custom field with foreach
- WordPress/Timber/Twig – Trying to output checkbox values [closed]
- Subpages menu on sidebar plus widgets
- highlight parent page on menu when child page is on sidebar (and not on menu)