You should use this attribute in the $args array to get children of specific page by Parent ID
'child_of' => 20,
More information:
https://codex.wordpress.org/Function_Reference/get_pages
Related Posts:
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- wp query to get child pages of current page
- How to paginate wordpress [gallery] shortcode?
- What kind of object type is WP_Query?
- Last post ordered by publish date using WP_Query on front page
- Shortcode returns escaped HTML tags
- WP_Query in a shortcode
- ‘&’ causes an error in my shortcode when I list the content of the page
- List the 5 most recent child pages
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- How to retrieve current page WP_Query arguments?
- wp_query add arguments using array_push if variable met
- Category attribute not working in custom shortcode
- Set order of returned items in the WP_Query() class/function
- Pagination of a WP_Query Loop in a child-page page template
- Need wp_query to return all children and grandchildren
- Database Queries Optimization with new WP_Query
- Search pages that are a child of the current page
- Orderby is working with one query but not with other
- Shortcode for latest -not expired- posts
- Gallery shortcode numerical sorting
- How to filter a query by date in a shortcode?
- How should I approach changing the template & $query as part of a shortcode’s execution?
- Get Child Page IDs by Parent ID
- Exclude parent with child pages from WP_Query
- How to Create a Random List of Child Pages
- complex get_posts() query to select child pages
- Shortcode Not Working in Slider When Added To Post Title
- Shortcode for custom query not returning results when attributes are added
- WP_query only displays one of my custom post type entries
- WP_Query returns different results from get_posts() [closed]
- Assign a minimum result count for WooCommerce query shortcodes?
- Using a Shortcode to List Posts from Multiple Categories
- When listing child pages run out of memory
- embedding shortcodes in php template
- wp-query, pull children of parent page
- How to get specific string in explode array?
- Get list of all Grandchild Pages
- Trouble passing attribute into shortcode function
- Woocommerce Shortcode which displays a table with product data
- Show child by slug, while knowing parent ID
- WP Query by 4 different taxonomies
- create custom shortcode wp and put php code in
- How to display a post(by id) along with css in a page?
- Shortcode attributes causes 500 error after updating the page
- pages shortcode filtering by category
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Paginate nested query of child posts
- WP_Query doesn’t return some child pages even though the database shows them
- Query by Category and Custom Field – Shortcode
- Get a page ancestor from a most viewed list
- How to take parameters from a function and make them editable as attributes in a shortcode
- How to modify WP Query to target the first most recent post to adjust content
- Object of class WP_Query could not be converted to int inside shortcode
- How can I create another instance of my custom shortcode
- Get Current CPT taxonomy category in shortcode
- Custom shortcode not displaying categories and correct date
- return wp query results in a shortcode
- More efficient query to display posts in same sub-category?
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- Get Child Custom Post Content on Single.php?
- Shortcode does not display pagination [duplicate]
- How to get child pages and add unique class only to active page?
- How to write a query-function as a query-shortcode?
- shortcode with $atts with strange results
- WP_query shortcode inside acf Repeater breaks the repeater loop
- How to prevent WP query searching in executed shortcodes
- Looping through tabular data
- Using next/previous_posts_link with customised search
- How to detect custom query inside `posts_where` hook?
- Is temporarily overwriting $wp_query a bad idea?
- Array Chunks and Inserting Varying HTML in WP_Query
- Modifying the Search Results
- WP_Query times out
- How to find a post id using the post_excerpt?
- WP_Query filter and order by meta ordering by wrong joined table
- Complex WP SQL Query
- Hide Administrators From User List except current user (administrator)
- How to figure out redirection and contents in hybrid solution containing word press content and legacy code (ASP.net)
- How to store and receive variables in WP sessions?
- How to list posts with disabled/closed comments, with pagination?
- Category ‘pad_counts’ & ‘parent’ conflict
- Display if author page is author page of current user
- WP_Query order by not working properly due to category I believe
- Modify WP_Query using pre_get_posts but only for frontend query?
- Function to retrieve IDs of posts, cache results, and improve wp_query
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- How to get pages of parent (non-recursive)?
- Combine query in WP_User_Query()
- How to get_comments() ordered by date and parent?
- WPQuery loop not giving expected output
- WP Query filters active on wrong query
- Gather same custom field values in one value in a select tag with wp_query
- Order Posts By Youtube Views
- Declare inline background image in functions.php
- Looking for a way to exclude frontpage and nav menu from query filter
- WP Query Obj: Set value to be unequal | Hide media by admin
- I want to capture the last day’s (today) posts in a category in the numbered order in acf