I don’t understand the distinction you are making between ‘sublevel’ query and ‘toplevel’ query, but this is how I pull children for a page.
$children = get_children(
array(
'post_parent' => $servid,
'post_type' => 'page',
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC'
)); ?>
Or…
$page_children = get_pages(
array(
'child_of' => $post->ID,
'post_type' => 'page',
'sort_column' => 'menu_order',
'order' => 'ASC'
));
In both cases I am sending the parent post’s ID as the first parameter.
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- WP_Query vs get_posts
- Get posts by meta data OR title
- Meta Query with date and time on the same Day before given time
- How to find out what “Blog pages show at most” is set to [duplicate]
- How do you Query posts with nothing in common?
- Serve specific “template” page at any URL that ends in its slug
- add active class based on permalink and url
- Display custom tags on pages that have a specific page parent
- Reset WordPress Post Query to default
- Get all posts which was posted on X Days WordPress
- get_posts output always same post
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- complex get_posts() query to select child pages
- Posts query according to meta box date
- Determine if ID is page or post and query the ID
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Facing problem with tax_query results
- Ordering Posts by parent category, name ascending
- When should you use WP_Query vs query_posts() vs get_posts()?
- get contents and permalink from a specified page
- WordPress pagination returns the same posts
- Get post ids from WP_Query?
- Some doubts about how the main query and the custom query works in this custom theme?
- How to query for most viewed posts and show top 5
- Using get_posts vs. WP_Query
- Delete all posts from WordPress except latest X posts
- Differences Between WP_Query() and get_posts() for Querying Posts?
- get_posts with multiple categories
- WordPress Custom Query to show posts from last x years
- Perform query with meta_value date
- get_the_title($postID) OR get_the_title()?
- How do I create my own nested meta_query using posts_where / posts_join?
- Use post__in and post__not_in together?
- Best practice for multiple queries on page
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- Get all posts without tags
- how to display active, upcoming and past event with featured listing with pagination
- Order by menu structure
- Targeting specific pages in the loop
- WP_query category__in not working, only pulls from first category
- What are the differences between “Latest Posts” and “Static Page”?
- Retrieve or Query Pages by ID
- Quickest way to get last or oldest post date – WP Query
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Multiple instances of Featured Image Query
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- Query with a meta value inside a given range
- Store sticky post’s ids in a transient
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- Multiple loops without repeating content
- Help with WP_Query – Too many mySQL queries
- Bypass “supress_filters” in WP Query
- get_post_meta slowing down my page load (in a plugin)
- Is there a reason why Pages are not publicly_queryable?
- Check return value of get_posts
- How to query for all posts that have a particular meta key?
- How can I override one post and make it display content for another post?
- Query post with meta value in set of values
- Exclude parent with child pages from WP_Query
- get_posts always returning the same number of posts = 5
- Conditional operator OR not working with custom fields
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- get_posts custom field
- How to apply a function to a metadata value before launch a WP Query?
- Woocommerce: order posts by meta key
- WPQuery calling specific posts problem
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- How to use ‘WP_Query’ or ‘query_posts’ to display content in a descending order
- How to access $wp_query object from array of posts given by get_posts?
- get_posts query matches too many results
- Max Posts and Memory Limit
- Query post and sort by custom value calculated with custom field on cpt
- Filter products on category AND tag
- Query post ordered by meta value that show first post that contained a tag
- get_posts query is taking about 40 seconds to execute
- pre_user_query vs pre_get_posts
- How do I stop the same post showing multiple times in a archive?
- Problem with my loops
- display the children of the post using the current page as the main parent
- pages shortcode filtering by category
- My entry results are not consistently alphabetized
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- I cannot get tax_query in get_posts() to work with custom taxonomy
- Getting the last X posts, but in ascending order of time
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- Modify query to exclude certain ids and certain parents and its corresponding children
- How to order by datediff in WP loop?
- Issue in If else condition [closed]
- Retrieve posts in custom post type and specific taxonomies
- Hierarchical List Pages as a table
- Exclude categories and subcategories in QueryLoop
- How do I correctly query posts from a post ID?
- How to write short code with if else to get page_id?
- Incorrect posts displayed on category page
- How to replecate the _fields parameter in custom REST api endpoint
- How to cache wordpress get_posts query using transients?