POST does not have parents, but categories. Only PAGE can have parent. So, the question is, what do you want to get?
In case of getting POSTS from different categories, just use get_posts
and add multiple categories.
As for pages, just use get_page_children
.
Related Posts:
- Nested meta_query with multiple relation keys
- numberposts? showposts? posts_per_page?
- Exclude Child Posts from WP_Query
- How can I save an array from a random post sequence for later use?
- All-in-One Event Calendar: Custom Query – Getting each event Instance [closed]
- Is there an action/filter called when WP_Query->query is finished and assigns posts
- Limit search results to exact match
- Highlighting Sub topic in a post?
- Pagination Not working on Home Page with 2 Query
- Multiple keyword search
- Get number of comments after modifying comment query
- Show default content if custom WP_Query has no posts
- List the 5 most recent child pages
- Include Sticky Posts with Custom Query
- $wpdb->insert inserting two rows in database
- Create unique page without header.php for json feed
- Set order of returned items in the WP_Query() class/function
- Sub-loop / nested loops Best Practices
- How to loop for every result found in the_content() when using the search query?
- Is there any advantage of using default WordPress Search instead of creating a custom one?
- Order By table field comment_status in WordPress > 4.0
- Clean up WordPress code that repeats
- How to optimize multiple WP_Query() calls on one page?
- Use post object from first query in second query
- Query to get siblings and parent page
- How to list custom fields as headers and list all pages sharing that custom field under it?
- Cutom wp_query for geolocation search, pagination not working
- Include data from custom table in WP_Query
- echo a specific meta_key queried through a custom post
- WP Group posts by year(desc) > month(desc) > date(asc)
- Better wordpress attachment query than this
- How to order posts on each different category?
- Get specific ACF key and value from all posts – no access to DB
- Orderby two meta fields not working
- Custom wp_query – I’m getting ‘all’ post, not the specific post in the query
- Don’t repeat posts from children in parent taxonomy query
- meta_query with array as value with multiple arrays
- Adding pagination to sub-wp_query within a singular post page
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How can I build a query that returns all attachments of a page and it’s children pages?
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- Where is this query?
- How to use wp query in my custom page without including header and footer in wordpress
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- WP Query for all events prior to current date
- How to extend WP_query to a specific table?
- Display the search results like the original pages
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Add to search posts query array with post IDS which will appear first
- Woocomerce – Order products by float attribute in archive pages
- Multiple values in WP_Query : category__and
- How to set up pagination for a custom loop on a global template (author.php, tag.php, archive.php?)
- WP_Query doesn’t works inside loop
- Custom query using WP_Query is not working
- Limit the number of posts from a specific category on index.php
- Get the type of an advanced custom field (ACF) in a WP_Query loop [closed]
- Switched from query_posts to wp_query, pagination no longer working
- WP_Query breaks pagination
- Pagination problem with multiple loops on the same page
- shortcode with $atts with strange results
- query only direct child and sub-terms of a current term archive
- I need to get all categories from a WP_Query
- Can wp_query return posts meta in a single request?
- Broken? WP_Query and “attachment” as a post type
- How to paginate attachments in a secondary query as gallery?
- How to make an activities stream mixing posts and comments?
- using wp_query to return posts w/ comment count > 0
- How to hide post content/meta from everyone except the post author and admin
- Too many posts cause slow load when paginating
- Order Posts by meta value AND published date
- Formulate a url to show posts with both taxonomy terms
- How to reduce the number of queries?
- WordPress Related Post by tags in Single.php
- Query custom post type by custom taxonomy (category slug)
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- Pre-Populate $wp_query settings with custom rewrite rules and custom template_redirect
- exclude a post from wp_query loop
- Is_single() conditional tag returns null in query
- Is it possible to query a custom field where the value is between two fields?
- WP_Query args to show posts from specific custom taxonomy
- How to query woocommerce product by pricing? [closed]
- filter wp_query result with custom field values
- All blog data on a page using custom query gives 404 for page 2 and onward
- construct complex queries with WP User Query
- How do I fit WP_Query arguments into a function?
- Pagination problem by using WP_Query
- Custom order of posts in wp_query and different taxonomies
- Update wp_query every week
- wp_insert_post with ACF Fields and WP Meta Query returns no rows until update
- Is meta_key used for ordering, filtering, or both?
- compare for multiple meta values for same key in wp_query
- Convert SQL Query to WP_Query
- Taxonomy Terms That Don’t Exist Display Results
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Add pagination to table generated by wp_query
- using next-page and previous page inside a wp_query
- restrict posts per page
- WP_Query sort by ACF date field (newest first) with blank dates first
- Pagination only showed when no category is set in wp_query