post_parent
should be the ID of the post parent, not the slug.
Apart from that, your code should work. If not, look for any posts_*
filters or pre_get_posts
actions that might influence your custom query
EDIT
Something else I have missed, $args
is already an array, so you do not need to add it another array when calling it.
$the_query = new WP_Query( array( $args ) );
should be
$the_query = new WP_Query( $args );
Related Posts:
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- pre_get_posts order by not working
- Help ordering Post loop by two meta values
- Order ascending is ignored in meta query?
- WP Query – order posts by meta field first and then order the rest
- Order posts by custom column using pre_get_posts
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Custom WP_Query order by post_meta and (author) user_meta
- How to order posts tag by tag?
- Slow SQL_CALC_FOUND_ROWS Query
- SQL Statement generated by WP_Query not producing expected results
- Order posts by tags count?
- Orderby = none not working [duplicate]
- Sorting Posts by custom field
- Order posts by date and then by custom field
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Recommended way to drop a pending query (in pre_get_posts)?
- Order by the results of a function with WP_query
- How to order posts in wp_query by a meta_value of the corresponding author
- Order by menu structure
- How to sort posts in admin by titles with dd.mm.yyyy format?
- WP_Query order by date in meta_value
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- Show all parents and children in custom post type in right order
- Order WP Query posts by custom order calculated from post meta values
- Searching through different categories on different pages code is not working
- How to display future posts – modified query still yields 404
- Meta query with order by another custom field
- Change default ordering of taxonomy terms – pre_get_terms
- Wp query orderby ‘title’ doesn’t work
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How to choose between hooking into per_get_posts or into parse_query
- (Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array
- Store sticky post’s ids in a transient
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- new WP_Query to get max price meta value not working
- WP_Query, pre_get_posts and offset
- Complex WP_Query order request: DESC by day, but then ASC by time
- Using meta_query with multiple keys and compare values
- Can I set my WP_Query to be a Main Query?
- Show scheduled posts in main loop but not in WP_Query?
- How to orderby multiple meta fields if some fields are empty
- Sort wordpress custom posts based on meta value
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- Order by summing multiple values
- Understanding the orderby in WP_Query?
- hide custom post types with specific meta key ON admin backend
- How to filter a query by multiple meta keys and order by other meta keys
- Multiple Orderby’s using random order WP_Query
- Shouldn’t I be able to modify the main query by this filter?
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- using pre_get_posts for search results not found
- Hide elements outside loop based on query
- Debugging wp_query orderby for taxonomy
- pre_get_posts – Trying to get property of non-object warning
- Advanced WP_Query with meta_query, orderby?
- How to Order a list of taxonomies? orderby?
- queried_object using pre_get_posts gets notices and warning
- date_query in pre_get_posts out of memory
- Sorting search results with custom dropdown
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Randomly select one of last 3 posts
- WP_Query orderby random do not repeat infinite scroll – one loop
- how to retrieve WP_Query without ordering by date [duplicate]
- How to apply pre_get_posts to a custom query?
- WP_Query, Paginate by Custom Field
- WP_Query orderby
- Block internal search queries with pre_get_posts and regex rules
- How can I order a post query’s results based on the number of matching taxonomy terms?
- is_user_logged_in not working from WP-API (wp-json)
- Search Exact on WordPress – Relevannsi Solution Not Working
- How to sort store location by specific category order in WP store locations
- Excluding posts from search results page with meta query not working
- pre_user_query vs pre_get_posts
- Custom WP Query order function possible?
- Can I alter the main loop to ‘orderby’ a custom callback?
- WP_Query random ordering not working since 5.4
- Meta query orderby meta_value_num sorting by role first
- How can I re-query post_type and rewrite the url?
- Order by value of Custom Field using url string
- WP Query with meta queries
- Order Element By Custom Field in WordPress
- Sorting with meta_query and multiple, optional meta keys
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- Display three sequential posts on each page load, without repeating previous
- Modify query to exclude certain ids and certain parents and its corresponding children
- Find by post_meta, then sort by post_meta, then sort by date (wp_posts)
- pre_get_posts or $where, which one to use?
- Filter WP_Query output before it is accessed (pre_get_posts)?
- query_posts with sorting on a custom datestamp
- Order by multiple meta keys on wordpress
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- WP_Query with several meta_query-statements and order by meta_value
- Custom post types loop on a page template
- Pre_get_post on CPT archive page
- Get posts that were most recently tagged