The posts query is not recursive by nature. And I don’t think that post_parent accepts multiple IDs, so you will likely need to loop and run this for multiple pages or play with query filters to do this in less requests (if performance becomes an issue).
Related Posts:
- Broken? WP_Query and “attachment” as a post type
- Is it possible to query all posts that don’t have an attachment?
- How to paginate wordpress [gallery] shortcode?
- Exclude Child Posts from WP_Query
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- Getting attachments by meta value
- Count the number of images uploded on the website
- How to paginate attachments in a secondary query as gallery?
- How do I exclude all images from a wp_query?
- get images attached to post
- Get attached media only
- query attachments of parent page if attachments of current page are smaller than …
- List the 5 most recent child pages
- wp_query for displaying attachments with a tag
- Show selected images on top in Media Manager
- How can I query posts with newly uploaded images?
- Sorting By Custom Posts With Attachments
- Attachment changing page’s permalink – $post not resetting?
- Set order of returned items in the WP_Query() class/function
- How to fetch only media that was already attached to a post/page?
- How to do meta_query for attachments?
- Get attachment by meta_key value
- How to show optimized list of posts with all their attachment images
- Where to put meta Keys
- WP_Query Attachment adds additional attachment count and need to link attachment to post url
- Better wordpress attachment query than this
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- wp_query get attachments in larger size
- Creating attachments archive in tags and categories
- Ignore image urls in wp_query search
- Don’t repeat posts from children in parent taxonomy query
- WP_Query: attachment image in “full” size?
- How to make a query returning pages from multiple parents
- get all images from the wordpress media library with link to the post they are associated with
- How to restrict add media library only to images of the same post family?
- how to get custom attachment url?
- WP_Query doesn’t works inside loop
- wp_get_attachment_image not to get the post_thumbnaill
- Query All Attachments and Order by Parent Publish Date
- How To Query All Attachment Images Found In Post Galleries
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Using WP_Query to get attachment returns empty set
- Some images not being returned with wp_get_attachment_image
- Loop issues when creating custom query for media uploader
- query only direct child and sub-terms of a current term archive
- Give attachments an archive page, and exclude unattached ones
- on attachment.php, how to display previous and next attachment links that follow the same order as a custom WP Query
- Use WP_Query with have_posts()?
- Why should i use wp_reset_postdata()?
- Meta Query querrying several post types based on ACF fields is broken after update to WP 4.1
- Hide posts from users with a specific role
- Show single post then all posts (with pagination)
- Show most popular post of last 12 months
- Refine/Filter WP_Query Posts with jQuery or Ajax
- Can’t get drafts with WP_Query using post_status parameter
- Get ONLY the count from wp_query without fetching posts
- Exclude admin from WP_Query Contributors
- Order by custom table and multiplication
- WP_Query posts by distance based on LAT & LNG in Database
- list pages using page.php and NOT page-{slug}.php
- Changing WP_Query params with url Query Var
- Moving the array pointer inside a WP_Query while loop
- From where is archive.php getting its posts?
- Help with WP_Query – Too many mySQL queries
- How can I make WP_Query get posts that have a tag but also have random other tags?
- Access WordPress query by index number outside the loop
- Pagination outside of loop
- Multisite – Global CPT – advices?
- Combine two queries into one to use in loop
- get data match with extra field value using wp_query for custom post
- WP_Query for a taxonomy with different taxonomy types
- Append URL query to next post link in custom query
- How to compare a date in custom field with today’s date in custom WP_Query?
- Executing query_posts after wp_insert_post
- Redirect Search to Form When No Product Results Are Found
- Related Posts Excluding Certain Categories
- Unlimited Page Sitemap Link
- Custom taxonomy in WP_Query not working
- Add category to my get_post query
- How to sort by most watched in X days/months
- WP_Query Pagination
- Using Ajax and WP_Query to load more posts on category page fails
- meta_query compare > not working
- 404 page on custom search pagination
- WP_Query about meta_key and its array value
- Query string order by custom field
- Paging works correctly on local version, but not live?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Paginate nested query of child posts
- Get Current CPT taxonomy category in shortcode
- Display images with same specific value?
- Sort Posts with custom meta key by default which is currently set as optional
- wp_query pagination links producing 404
- How return normal search result using wp_ajax action for wordpress
- Custom post types loop on a page template
- Pagination problem with multiple loops on the same page
- How to query posts from single post format on Genesis framework
- I want to capture the last day’s (today) posts in a category in the numbered order in acf
- How do I have multiple metaqueries inside one wordpress query
- Removing filename searches when searching attachments