Solved my own question after further research and testing 🙂 Ended up using 2 queries passing the result from one query to the other. Hope this helps someone.
$argsIssues = array( 'post_type' => 'magazine',
'post_parent__in' => array(20321), //get issue(children) posts from the issues(parent)
'fields' => 'ids' //query only the postIDs
);
$q = get_posts( $argsIssues ); //run $argsIssues query
$argsArticles = array( 'post_type' => 'magazine',
'post_parent__in' => $q //get article(grandchildren) posts from issue(children) posts.
);
query_posts( $argsArticles ); //run $argsArticles query
//while loop goes here to display posts from $argsArticles query
Related Posts:
- Query all posts where a meta key does not exist
- Exclude a category from WP_Query
- Single loop for wp_query and wp_user_query
- WP_Query orderby custom field then post_date in one query
- query multiple taxonomies
- Custom Post Type, WP_Query and ‘orderby’
- Include post id[s] into WP_Query()
- Syntax to get the Nth item in a list of custom post types?
- Grab 5 latest posts from custom post type ‘announcements’
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Using Query Posts With Multiple Post Types And A Taxonomy
- Sort the main query in subcategories/terms?
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- Custom Taxonomy List links being re-written
- Get post info inside modal window?
- Want to filter only parent post in admin area
- Query Custom Post by Category
- Pagination Issue: Custom Post Type In Index
- Having trouble with custom date field for CPT query (WordPress)
- Quickest way to get last or oldest post date – WP Query
- Display posts if a custom field value is equal to another custom field value
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- CPT posts listed by category with custom rewrite URL, please help!
- How to use WP_Query in a CPT achive page?
- Use get_post_types to query only custom posts types
- How can i skip same post from taxonomy term?
- Using global $post; to get featured image for custom post via WP_Query
- Query custom post type by category slug
- Can’t query tag and post_type at the same time
- Pagination on a custom post type loop
- WP_Query orderby modified to include custom meta changes
- Search / Filter posts on Title/Content OR Tags
- Converting the_content string to an array?
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- What’s the WP way to load remaining custom posts?
- Several post types on WP Query by tag and taxonomy
- Filter Posts from the Main Query
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- How can I group posts by months and years?
- Display post from a date range from custom field
- Displaying a div from an assigned meta_value when on a page
- Creating two loops based on different logic
- Getting a custom post’s custom field based on another custom post’s custom field select
- Show message when query has no posts
- WP_Query not resetting after wp_reset_postdata
- Custom post type to lead to single post type instead of shortcode modal
- Filter posts of custom post type by meta key in (List All Section)
- Query Posts that have Custom Taxonomy
- Display post from custom post type
- Query Posts, order by meta value
- Foreach loop returning more than one item when querying taxonomy
- how to compare different timestamps in wp-query for events custom post types?
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Sorting the Loop by Taxonomy Value
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Ordering by meta value not working
- Custom wp-query display post only today
- Create if else for post types in WP_Query ‘post__in’ values
- Custom post type query with taxonomy
- Display Custom Post Type Based on Taxonomy With WP_Query()
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- post_type incorrect for custom post type
- Live search by custom tag
- Custom Post Type – Display all, wrap in groups of 3
- Staggering featured post using ‘sticky’
- Ajax load more inside custom post type taxonomy
- How to get the posts that my following users are liked?
- Only show categories that have posts within custom post type
- Create a custom wp_query from a specific custom post type with specific taxonomy
- SQL LIKE in WP_Query
- How can you use a page for a custom post type?
- Display all Custom taxonomy terms and their relevant custom posts
- Query breaking with ‘posts_per_page’ => -1
- WP Query with multiple post types ordered by custom meta date then published date
- CPT Efficient way to display posts from different categories with custom query
- How To Loop Through list with Custom Post Types
- CPT or Custom Table for Repository of Serial Numbers
- Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values
- Custom Post Type + Category archive
- Values inside a custom field to determine which category posts to display
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Pop up showing same content on all posts display.
- Custom post-type’s pagination not working in category.php
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Querying meta values within an array
- Count of posts with meta_key filled in?
- Filter Custom post type by another Custom post type
- Archive page – problem with pagination
- Are custom posts included when getting a categories’ posts?
- Query order by meta value force specific tag first
- Display ACF object field data using Elementor Custom Query
- Default WordPress Query for a Specific Custom Post Type URL
- Sort ACF by custom taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy